summaryrefslogtreecommitdiffstats
path: root/contrib/pacscripts.sh.in
diff options
context:
space:
mode:
authorJason St. John <jstjohn@purdue.edu>2013-11-08 08:53:33 +0100
committerAllan McRae <allan@archlinux.org>2013-11-15 02:02:27 +0100
commita15fd48016014249a13db7a437b5e4f5937f6158 (patch)
treeeecd9c3717fcb05d58983ce89f4d3778502f0cc4 /contrib/pacscripts.sh.in
parent7bfaa358ea45c5d527a382bb5fef734b3134bd6f (diff)
downloadpacman-a15fd48016014249a13db7a437b5e4f5937f6158.tar.gz
pacman-a15fd48016014249a13db7a437b5e4f5937f6158.tar.xz
Improve --help switch output for pacman contrib and pacman scripts
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<pacman version> 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 <karol.blazewicz at gmail.com> Signed-off-by: Jason St. John <jstjohn@purdue.edu>
Diffstat (limited to 'contrib/pacscripts.sh.in')
-rw-r--r--contrib/pacscripts.sh.in16
1 files changed, 9 insertions, 7 deletions
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} <pkgname|pkgfile>"
+ 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 "$@"