From a15fd48016014249a13db7a437b5e4f5937f6158 Mon Sep 17 00:00:00 2001 From: "Jason St. John" Date: Fri, 8 Nov 2013 02:53:33 -0500 Subject: Improve --help switch output for pacman contrib and pacman scripts MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Unify the formatting of the --help switch for pacman utils, if it exists. All of the pacman utils will now output help text using the following format: util-name (pacman) v one line description of util's purpose Usage: util-name [options] -b, --bar whatever --bar does -f, --foo whatever --foo does -h, --help display this help message Reported-by: Karol Błażewicz Signed-off-by: Jason St. John --- contrib/pacscripts.sh.in | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'contrib/pacscripts.sh.in') diff --git a/contrib/pacscripts.sh.in b/contrib/pacscripts.sh.in index 62c4e35b..8453f9c8 100644 --- a/contrib/pacscripts.sh.in +++ b/contrib/pacscripts.sh.in @@ -46,16 +46,18 @@ error() { } usage() { - echo "This program prints out the {pre,post}_{install,remove,upgrade} scripts" - echo "of a given package." - echo "Usage: $myname pkgname|pkgfile" + echo "${myname} (pacman) v${myver}" echo - echo " OPTIONS:" + echo "Prints the {pre,post}_{install,remove,upgrade} scripts of a given package." + echo + echo "Usage: ${myname} " + echo + echo " Options:" echo " -h, --help Print this help message" echo " -v, --version Print program name and version" echo - echo "Example: $myname gconf-editor" - echo "Example: $myname gconf-editor-2.24.1-1-x86_64.pkg.tar.gz" + echo "Example: ${myname} gconf-editor" + echo "Example: ${myname} gconf-editor-3.0.1-3-x86_64.pkg.tar.xz" } version() { @@ -70,7 +72,7 @@ spacman() { else if ! type -p sudo; then error "Cannot find the sudo binary! Is sudo installed?" - error "Otherwise try to run the program as root" + error "Otherwise, try to run the program as root" exit 1 else sudo pacman "$@" -- cgit v1.2.3-54-g00ecf