summaryrefslogtreecommitdiff
path: root/sendmailadvanced.in
diff options
context:
space:
mode:
Diffstat (limited to 'sendmailadvanced.in')
-rwxr-xr-xsendmailadvanced.in31
1 files changed, 20 insertions, 11 deletions
diff --git a/sendmailadvanced.in b/sendmailadvanced.in
index 2bb69ce..c1aef2e 100755
--- a/sendmailadvanced.in
+++ b/sendmailadvanced.in
@@ -1,17 +1,19 @@
#!/bin/bash
verwendung() {
- >&2 echo 'This is sendmailadvanced version #VERSION#'
+ >&2 echo 'sendmailadvanced encrypts emails and generates stamps either in situ or in a pipe. For that it uses hashcash and gnupg.'
>&2 echo ''
- >&2 echo 'usage: sendmailadvanced [(-h|--hook) hook] [(-i|--inline) file | -t|--no-inline] [-e|--[no-]encrypt] [-s|--[no-]stamp]'
- >&2 echo ' -h|--hook: activate hook'
- >&2 echo ' -i|--inline: enhance email file in situ'
- >&2 echo ' "--inline -" has the same effect as "-t"'
- >&2 echo ' conflicts with -t|--no-inline'
- >&2 echo ' -t|--no-inline: enhance email from stdin to stdout'
- >&2 echo ' conflicts with -i|--inline'
- >&2 echo ' -e|--[no-]encrypt: do (not) encrypt'
- >&2 echo ' -s|--[no-]stamp: do (not) stamp'
+ >&2 echo 'Usage: sendmailadvanced [OPTIONS]'
+ >&2 echo ' -h,--hook=hook activate hook'
+ >&2 echo ' -i,--inline=file enhance email file in situ.'
+ >&2 echo ' "--inline -" has the same effect as "-t".'
+ >&2 echo ' Conflicts with -t|--no-inline.'
+ >&2 echo ' -t,--no-inline enhance email from stdin to stdout.'
+ >&2 echo ' Conflicts with -i|--inline.'
+ >&2 echo ' -e,--[no-]encrypt do (not) encrypt'
+ >&2 echo ' -s,--[no-]stamp do (not) stamp'
+ >&2 echo \
+'#HELPTEXT# #'
exit 1
}
@@ -62,7 +64,7 @@ fi
gpg --list-keys "${gpg_recipient}" &> /dev/null || encrypt=false
which hashcash &> /dev/null || stamp=false
-eval set -- "$(getopt -o eh:i:st --long encrypt,no-encrypt,hook:,inline:,no-inline,stamp,no-stamp -n "$(basename "$0")" -- "$@" || echo verwendung)"
+eval set -- "$(getopt -o eh:i:st --long encrypt,no-encrypt,hook:,help,inline:,no-inline,stamp,no-stamp,version -n "$(basename "$0")" -- "$@" || echo verwendung)"
while true
do
@@ -71,6 +73,13 @@ do
shift
hooks[${#hooks[@]}]="$1"
;;
+ --help)
+ verwendung 0
+ ;;
+ --version)
+ echo '#VERSION#'
+ exit 0
+ ;;
-i|--inline)
${dForced} && verwendung
shift