summaryrefslogtreecommitdiff
path: root/pbs-plumb-config
diff options
context:
space:
mode:
authorLuke Shumaker <LukeShu@sbcglobal.net>2013-06-02 21:59:06 -0600
committerLuke Shumaker <LukeShu@sbcglobal.net>2013-06-02 21:59:06 -0600
commit606b0a937527e43cf952c41cb8970fca7db3a55b (patch)
tree8df12dfd542ec6181668b61cc2900b8e2c0635bc /pbs-plumb-config
parent48b5d4a35833c3cd528576e085598c72227b1624 (diff)
fix the usage text for several commands
Diffstat (limited to 'pbs-plumb-config')
-rwxr-xr-xpbs-plumb-config17
1 files changed, 15 insertions, 2 deletions
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
}