diff options
author | Trygve Laugstøl <trygvis@inamo.no> | 2013-02-01 12:46:56 +0100 |
---|---|---|
committer | Trygve Laugstøl <trygvis@inamo.no> | 2013-02-01 12:46:56 +0100 |
commit | 0bad1dc709ee21f3e93cfa0866fc0478a5e884a0 (patch) | |
tree | 2acd309f689c0afe9a03c823493443752d4b6960 /lib/common | |
parent | 97036aeae73cc2a63219c7b792ab5f18c7d98cd1 (diff) | |
download | app.sh-0bad1dc709ee21f3e93cfa0866fc0478a5e884a0.tar.gz app.sh-0bad1dc709ee21f3e93cfa0866fc0478a5e884a0.tar.bz2 app.sh-0bad1dc709ee21f3e93cfa0866fc0478a5e884a0.tar.xz app.sh-0bad1dc709ee21f3e93cfa0866fc0478a5e884a0.zip |
o Consistent usage() usage/flow.
Diffstat (limited to 'lib/common')
-rwxr-xr-x | lib/common | 21 |
1 files changed, 18 insertions, 3 deletions
@@ -40,7 +40,7 @@ assert_is_app() { fi } -usage() { +show_help() { message=${1-} if [[ $message != "" ]] @@ -48,9 +48,24 @@ usage() { echo $message fi - if [ "`declare -f usage_inner >/dev/null; echo $?`" = 0 ] + if [ "`declare -f usage_text >/dev/null; echo $?`" = 0 ] + then + usage_text + fi + exit 1 +} + +usage() { + message=${1-} + + if [[ $message != "" ]] + then + echo $message >&2 + fi + + if [ "`declare -f usage_text >/dev/null; echo $?`" = 0 ] then - usage_inner >&2 + usage_text >&2 fi exit 1 } |