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/rankmirrors.sh.in | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'contrib/rankmirrors.sh.in') 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 ." echo echo "This is free software; see the source for copying conditions." -- cgit v1.2.3-24-g4f1b