rp

simple email tools
git clone https://git.parazyd.org/rp
Log | Files | Refs | README | LICENSE

commit 898fa118e38891b323c1cd6bfb2d562deb39b933
parent 2afa1be268605eee87ec3cd41013df768fbe4365
Author: parazyd <parazyd@dyne.org>
Date:   Tue, 18 Dec 2018 09:06:26 -0500

Add verbose mode in rpsend's outbox listing.

Diffstat:
Mbin/rpsend | 19+++++++++++++++++--
1 file changed, 17 insertions(+), 2 deletions(-)

diff --git a/bin/rpsend b/bin/rpsend @@ -7,14 +7,24 @@ profile="${RPPROFILE:-$HOME/.rp/default}" usage() { - printf " * usage: %s [-n] [-l] [-a] < email\\n" "$(basename "$0")" + printf " * usage: %s [-n] [-v] [-l] [-a] < email\\n" "$(basename "$0")" printf "\\t-n: dry run\\n" printf "\\t-l: list outbox\\n" + printf "\\t-v: verbose list output\\n" printf "\\t-a: send all\\n" exit 1 } -listoutbox() { find "$profile"/tmp/outbox -type f ; } +listoutbox() { + headers="Date To Subject" + + for i in $(find "$profile"/tmp/outbox -type f); do + echo "$i" + if [ -n "$verbose" ];then + printf "%s\\n\\n" "$(rpheaders -v $headers < $i)" + fi + done +} for i in "$@"; do case "$i" in @@ -23,6 +33,11 @@ for i in "$@"; do shift 1 continue ;; + -v) + verbose="true" + shift 1 + continue + ;; -l) listoutbox exit 0