diff options
Diffstat (limited to 'functions')
-rwxr-xr-x | functions/arguments.sh | 4 | ||||
-rwxr-xr-x | functions/usage.sh | 19 |
2 files changed, 16 insertions, 7 deletions
diff --git a/functions/arguments.sh b/functions/arguments.sh index 2c1266f78..b10a82532 100755 --- a/functions/arguments.sh +++ b/functions/arguments.sh @@ -127,7 +127,7 @@ Arguments () fi exit 0 elif [ "${IS_FRONTEND}" = "true" ]; then - Usage 0 + Usage --exit fi ;; @@ -137,7 +137,7 @@ Arguments () ;; -u|--usage) - Usage 0 + Usage --exit shift ;; diff --git a/functions/usage.sh b/functions/usage.sh index 388763895..4c4f585dc 100755 --- a/functions/usage.sh +++ b/functions/usage.sh @@ -11,10 +11,6 @@ Usage () { - if [ -z "${1}" ]; then - Echo_error "Usage() requires an exit code" - fi - echo "${PROGRAM_NAME} - ${DESCRIPTION}" printf "\nUsage:\n\n" @@ -29,5 +25,18 @@ Usage () echo echo "Try \"${PROGRAM} --help\" for more information." - exit $1 + case $1 in + --fail) + exit 1 + ;; + --exit) + exit 0 + ;; + "") + : + ;; + *) + Echo_error "Unexpected parameter to Usage(): $1" + ;; + esac } |