diff options
author | Luke Shumaker <LukeShu@sbcglobal.net> | 2013-06-02 21:59:06 -0600 |
---|---|---|
committer | Luke Shumaker <LukeShu@sbcglobal.net> | 2013-06-02 21:59:06 -0600 |
commit | 606b0a937527e43cf952c41cb8970fca7db3a55b (patch) | |
tree | 8df12dfd542ec6181668b61cc2900b8e2c0635bc | |
parent | 48b5d4a35833c3cd528576e085598c72227b1624 (diff) |
fix the usage text for several commands
-rwxr-xr-x | pbs-package-commit | 2 | ||||
-rwxr-xr-x | pbs-plumb-config | 17 | ||||
-rwxr-xr-x | pbs-plumb-download | 6 |
3 files changed, 22 insertions, 3 deletions
diff --git a/pbs-package-commit b/pbs-package-commit index 7af6fc5..3b3dfe5 100755 --- a/pbs-package-commit +++ b/pbs-package-commit @@ -18,7 +18,7 @@ usage() { echo '' echo ' ====================== `git commit` usage ======================' echo '' - git commit -h + git commit -h 2>&1 || true } main() { diff --git a/pbs-plumb-config b/pbs-plumb-config index bbb733f..d885256 100755 --- a/pbs-plumb-config +++ b/pbs-plumb-config @@ -1,5 +1,7 @@ #!/bin/bash +. pbs-plumb-shlib + ## # Usage: list FILE # stdout: A newline-separated list of settings in FILE @@ -21,8 +23,19 @@ get() { git config --file "$file" -z --get "$setting" } +usage() { + echo "Usage: ${0##*/} COMMAND [COMMAND-ARGUMENTS]" + echo "Work with /etc/libretools.d/pbs-convert.conf" + echo + echo "Commands:" + echo " list List the variables set in the file" + echo " get VARNAME Get the value of VARNAME" +} + main() { - [[ $# < 1 ]] && { usage; return 1; } + in_array '-h' "$@" && { usage; return 0; } + [[ $# < 1 ]] && { usage >&2; return 1; } + local cmd=$1 shift @@ -35,7 +48,7 @@ main() { get "$file" "$@" return $?;; *) - usage + usage >&2 return 1;; esac } diff --git a/pbs-plumb-download b/pbs-plumb-download index e321343..1ba4e68 100755 --- a/pbs-plumb-download +++ b/pbs-plumb-download @@ -18,7 +18,13 @@ . libremessages +usage() { + echo "Usage: ${0##*/} SOURCE" + echo "Downloads a source as configured in pbs-convert.conf" +} + main() { + in_array '-h' "$@" && { usage; return 0; } [[ $# != 1 ]] && { usage; return 1; } local source=$1 local url="$(pbs-plumb-config get "source.$source.url")" |