summaryrefslogtreecommitdiff
path: root/contrib/rankmirrors.sh.in
diff options
context:
space:
mode:
authorJason St. John <jstjohn@purdue.edu>2013-11-08 02:53:33 -0500
committerAllan McRae <allan@archlinux.org>2013-11-15 11:02:27 +1000
commita15fd48016014249a13db7a437b5e4f5937f6158 (patch)
treeeecd9c3717fcb05d58983ce89f4d3778502f0cc4 /contrib/rankmirrors.sh.in
parent7bfaa358ea45c5d527a382bb5fef734b3134bd6f (diff)
downloadpacman-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/rankmirrors.sh.in')
-rw-r--r--contrib/rankmirrors.sh.in13
1 files changed, 9 insertions, 4 deletions
diff --git a/contrib/rankmirrors.sh.in b/contrib/rankmirrors.sh.in
index 82bf9ae0..0c4c7345 100644
--- a/contrib/rankmirrors.sh.in
+++ b/contrib/rankmirrors.sh.in
@@ -21,26 +21,31 @@
# traps interrupt key to spit out pre-interrupt info
trap finaloutput INT
+declare -r myname='rankmirrors'
+declare -r myver='@PACKAGE_VERSION@'
+
usage() {
- echo "Usage: rankmirrors [options] MIRRORFILE | URL"
+ echo "${myname} (pacman) v${myver}"
echo
echo "Ranks pacman mirrors by their connection and opening speed. Pacman mirror"
echo "files are located in @sysconfdir@/pacman.d/. It can also rank one mirror if the URL is"
echo "provided."
echo
+ echo "Usage: ${myname} [options] MIRRORFILE | URL"
+ echo
echo "Options:"
echo " --version show program's version number and exit"
echo " -h, --help show this help message and exit"
echo " -n NUM number of servers to output, 0 for all"
echo " -t, --times only output mirrors and their response times"
- echo " -u, --url test a specific url"
+ echo " -u, --url test a specific URL"
echo " -v, --verbose be verbose in ouptut"
- echo " -r, --repo specify a specific repo name instead of guessing"
+ echo " -r, --repo specify a repository name instead of guessing"
exit 0
}
version() {
- echo "rankmirrors (pacman) @PACKAGE_VERSION@"
+ echo "${myname} (pacman) ${myver}"
echo "Copyright (c) 2009 Matthew Bruenig <matthewbruenig@gmail.com>."
echo
echo "This is free software; see the source for copying conditions."