aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorTrygve Laugstøl <trygvis@inamo.no>2013-02-01 12:46:56 +0100
committerTrygve Laugstøl <trygvis@inamo.no>2013-02-01 12:46:56 +0100
commit0bad1dc709ee21f3e93cfa0866fc0478a5e884a0 (patch)
tree2acd309f689c0afe9a03c823493443752d4b6960 /lib
parent97036aeae73cc2a63219c7b792ab5f18c7d98cd1 (diff)
downloadapp.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')
-rwxr-xr-xlib/common21
1 files changed, 18 insertions, 3 deletions
diff --git a/lib/common b/lib/common
index 63f712a..0c8cdbd 100755
--- a/lib/common
+++ b/lib/common
@@ -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
}