diff options
Diffstat (limited to 'app')
-rwxr-xr-x | app | 16 |
1 files changed, 14 insertions, 2 deletions
@@ -13,6 +13,11 @@ mkdir -p $BASEDIR/.app/var/pid mkdir -p $BASEDIR/.app/var/download method_usage() { + if [ -n "$1" ] + then + echo "Error:" "$@" >&2 + fi + echo "usage: $0 [-n name] [-i instance] <method group>" >&2 echo "" >&2 echo "Available method groups:" >&2 @@ -78,9 +83,9 @@ main() { esac done + local method=$1 if [ $# -gt 0 ] then - method=$1 shift fi @@ -88,7 +93,14 @@ main() { app) method_app "$name" "$instance" "$@" ;; conf) method_conf "$name" "$instance" "$@" ;; operate) method_operate "$name" "$instance" "$@" ;; - *) method_usage ;; + *) + if [ -z "$method" ] + then + method_usage + else + method_usage "No such method group: $method" + fi + ;; esac exit $? } |