From 0d86856e51af59a670cdb96762d74031abb5025b Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Fri, 24 Feb 2012 19:05:44 -0200 Subject: Fixing config help --- firma | 26 +++++++++++++++++++++----- 1 file changed, 21 insertions(+), 5 deletions(-) (limited to 'firma') diff --git a/firma b/firma index e1c773f..692328f 100755 --- a/firma +++ b/firma @@ -2537,22 +2537,22 @@ case "$NUM_OF_ARGS" in case "$OPTION" in # valid short option - -a|-c|-e|-p) + -a|-c|-e|-p|-h) ;; # valid long option - --admin-task|--create-newlist|--email-admin-task|--process-message) + --admin-task|--create-newlist|--email-admin-task|--process-message|--help) ;; # valid short option called with too many arguments - -h|-v) + -v) echo >&2 "$BASENAME: too many arguments -- $@" Usage EXIT_CODE=1 ;; # valid long option called with too many arguments - -help|-version) + --version) echo >&2 "$BASENAME: too many arguments -- $@" Usage EXIT_CODE=1 @@ -2616,8 +2616,24 @@ if [[ "$EXIT_CODE" == "0" ]]; then esac ;; 2) + # help options + if [ "$OPTION" == "--help" ] || [ "$OPTION" == "-h" ]; then + + if [ "$ARG" == "config" ]; then + + ConfigHelp + EXIT_CODE=0 + + else + + echo >&2 "$BASENAME: invalid help section -- $ARG" + Usage + EXIT_CODE=1 + + fi + # if firma.conf exists and can be read - if [[ ! -r "$FIRMA_CONFIG_FILE" ]]; then + elif [[ ! -r "$FIRMA_CONFIG_FILE" ]]; then LogMessage "FATAL: Cannot source \`$FIRMA_CONFIG_FILE': No such file or directory" EXIT_CODE=1 -- cgit v1.2.3