]> arthur.barton.de Git - ax-unix.git/blobdiff - mail/wrapper/mail-wrapper
mail-wrapper: Add dummy "--suppress-empty" option
[ax-unix.git] / mail / wrapper / mail-wrapper
index 045f94b97eb727183b89370f2c47f6f7b29723b9..9097453abe36e49ec62dbd3f0e6d5e5d74fa9321 100755 (executable)
@@ -20,26 +20,28 @@ for dir in "$HOME/lib" "$HOME/.ax" /usr/local /opt/ax /usr; do
        [ -r "$ax_common" ] && . "$ax_common"
 done
 if [ -z "$ax_common_sourced" ]; then
-       echo "Error ($(basename "$0")): \"ax-common.sh\" not found, aborting!"
+       echo "Error ($NAME): \"ax-common.sh\" not found, aborting!" >&2
        echo "Please install 'ax-unix', \"Alex' UNIX Tools & Scripts\", and try again."
        exit 99
 fi
 unset dir ax_common ax_common_sourced
 
 usage() {
-       echo >&2
-       echo "Usage:" >&2
-       echo "  $NAME [--help|--usage]" >&2
-       echo "  $NAME {parameters} [<command> [<arg> [<…>]]]" >&2
-       echo >&2
-       echo "  -C                      Use the \"C\" locale, no localized (error) messages." >&2
-       echo "  --errors|-e             Generate email on errors only." >&2
-       echo "  --from|-f               Email address of the sender of the email." >&2
-       echo "  --subject|-s <subject>  Subject for the email." >&2
-       echo "  --to|-t <address>       Email address to send the email to." >&2
-       echo >&2
-       echo "When no <command> is given, $NAME reads from standard input." >&2
-       echo >&2
+       {
+               echo
+               echo "Usage:"
+               echo "  $NAME [--help|--usage]"
+               echo "  $NAME {parameters} [<command> [<arg> [<…>]]]"
+               echo
+               echo "  -C                      Use the \"C\" locale, no localized (error) messages."
+               echo "  --errors|-e             Generate email on errors only."
+               echo "  --from|-f               Email address of the sender of the email."
+               echo "  --subject|-s <subject>  Subject for the email."
+               echo "  --to|-t <address>       Email address to send the email to."
+               echo
+               echo "When no <command> is given, $NAME reads from standard input."
+               echo
+       } >&2
        exit "${1:-0}"
 }
 
@@ -84,6 +86,10 @@ while [[ $# -gt 0 ]]; do
                        [[ $# -gt 0 ]] || syntax_error
                        subject="$1"
                        ;;
+               "--suppress-empty")
+                       # Ignore this switch for compatibility with an other
+                       # "mail-wrapper" script. This is the default anyway!
+                       ;;
                "--to"|"-t")
                        shift
                        [[ $# -gt 0 ]] || syntax_error