summaryrefslogtreecommitdiff
path: root/pbs-plumb-config
diff options
context:
space:
mode:
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
}