aboutsummaryrefslogtreecommitdiff
path: root/lib/common
diff options
context:
space:
mode:
Diffstat (limited to 'lib/common')
-rwxr-xr-xlib/common15
1 files changed, 15 insertions, 0 deletions
diff --git a/lib/common b/lib/common
index e90f77b..63f712a 100755
--- a/lib/common
+++ b/lib/common
@@ -40,6 +40,21 @@ assert_is_app() {
fi
}
+usage() {
+ message=${1-}
+
+ if [[ $message != "" ]]
+ then
+ echo $message
+ fi
+
+ if [ "`declare -f usage_inner >/dev/null; echo $?`" = 0 ]
+ then
+ usage_inner >&2
+ fi
+ exit 1
+}
+
debug() {
[[ $echo_debug == no ]] || echo "D: $usage_app: $@" 2>&1
}