From 606b0a937527e43cf952c41cb8970fca7db3a55b Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Sun, 2 Jun 2013 21:59:06 -0600 Subject: fix the usage text for several commands --- pbs-plumb-config | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) (limited to 'pbs-plumb-config') 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 } -- cgit v1.2.3-54-g00ecf