From fc7a39f18241ab731d87f7a80ef2bf36151dc184 Mon Sep 17 00:00:00 2001 From: Trygve Laugstøl Date: Mon, 4 Feb 2013 17:37:40 +0100 Subject: o Fixing usage for 'app'. --- app | 25 +++++++++---------------- 1 file changed, 9 insertions(+), 16 deletions(-) diff --git a/app b/app index 8fcc585..6f5a836 100755 --- a/app +++ b/app @@ -1,20 +1,13 @@ #!/bin/bash -e -usage() { - if [ -n "$1" ] - then - echo "Error:" "$@" >&2 - fi - - echo "usage: $0 " >&2 - echo "" >&2 - echo "Available commands:" >&2 - echo " init" >&2 - echo " conf" >&2 - echo " operate" >&2 - echo "" >&2 - echo "Run $0 -h for more help" >&2 - exit 1 +usage_text() { + echo "usage: $usage_app " + echo "" + echo "Available porcelain commands:" + grep_path "/app-.*$" "$APPSH_HOME/bin" | sed "s,^.*/app-, ," + echo "" + echo "Available plumbing commands:" + grep_path "/app-.*$" "$APPSH_HOME/libexec" | sed "s,^.*/app-, ," } PRG="$0" @@ -38,7 +31,7 @@ while getopts "h" opt do case $opt in h) - usage + show_help ;; D) echo_debug=yes -- cgit v1.2.3