From 97036aeae73cc2a63219c7b792ab5f18c7d98cd1 Mon Sep 17 00:00:00 2001 From: Trygve Laugstøl Date: Fri, 1 Feb 2013 09:28:18 +0100 Subject: libexec/app-resolver-maven: Better argument checking. lib/common: Starting a way to have a common usage/help semantics. --- lib/common | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'lib') 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 } -- cgit v1.2.3