From 5a89a12aa012ceb3ee03ad4ced8d8bde44176e6f Mon Sep 17 00:00:00 2001 From: Allan McRae Date: Thu, 25 Nov 2010 13:20:06 +1000 Subject: pacman-key: improve usage output Make the usage output display nicely on 80 character width terminals. Also fix parsing of "-h" and "-v" options and avoid root check when run with no commands. Signed-off-by: Allan McRae --- scripts/pacman-key.sh.in | 38 +++++++++++++++++++++----------------- 1 file changed, 21 insertions(+), 17 deletions(-) (limited to 'scripts') diff --git a/scripts/pacman-key.sh.in b/scripts/pacman-key.sh.in index 0f558a9c..ccaf4b2a 100644 --- a/scripts/pacman-key.sh.in +++ b/scripts/pacman-key.sh.in @@ -61,20 +61,24 @@ usage() { printf "$(gettext " Default is set in %s")\n" "@sysconfdir@/pacman.conf" echo echo "$(gettext "The available commands are:")" - echo "$(gettext " pacman-key -a | --add [] ... - add the key contained ")" - echo "$(gettext " in (empty for stdin)")" - echo "$(gettext " pacman-key -d | --del ... - remove the key ")" - echo "$(gettext " pacman-key -e | --export ... - output the key ")" - echo "$(gettext " pacman-key -r | --receive ... - fetch the keyids from")" - echo "$(gettext " the specified keyserver URL")" - echo "$(gettext " pacman-key -t | --trust ... - set the trust level of the given key")" - echo "$(gettext " pacman-key -u | --updatedb - update the trustdb of pacman")" - echo "$(gettext " pacman-key --reload - reloads the keys from the keyring package")" - echo "$(gettext " pacman-key -l | --list - list keys")" - echo "$(gettext " pacman-key -f | --finger [ ... - list fingerprint for specified keyids (or for all, if none is specified)")" - echo "$(gettext " pacman-key --adv - use pacman's keyring as target for advanced commands")" - echo "$(gettext " pacman-key -h | --help - displays this message")" - echo "$(gettext " pacman-key -v | --version - displays the current version")" + echo "$(gettext " -a | --add [] ... - add the key contained in ")" + echo "$(gettext " (empty for stdin)")" + echo "$(gettext " -d | --del ... - remove the key ")" + echo "$(gettext " -e | --export ... - output the key ")" + echo "$(gettext " -f | --finger [] ... - list fingerprint for specified keyids")" + echo "$(gettext " (or for all, if no key is specified)")" + echo "$(gettext " -h | --help - displays this message")" + echo "$(gettext " -l | --list - list keys")" + echo "$(gettext " -r | --receive ... - fetch the keyids from the specified")" + echo "$(gettext " keyserver URL")" + echo "$(gettext " -t | --trust ... - set the trust level of the given key")" + echo "$(gettext " -u | --updatedb - update the trustdb of pacman")" + echo "$(gettext " -v | --version - displays the current version")" + echo "$(gettext " --adv - use pacman's keyring as target for")" + echo "$(gettext " advanced gpg commands")" + echo "$(gettext " --reload - reloads the keys supplied by your")" + printf "$(gettext " distribution in %s")"'@prefix@/share/pacman' + echo } version() { @@ -214,7 +218,7 @@ if ! type gettext &>/dev/null; then } fi -if [[ $1 != "--version" && $1 != "-v" && $1 != "--help" && $1 != "-h" ]]; then +if [[ $1 != "--version" && $1 != "-v" && $1 != "--help" && $1 != "-h" && $1 != "" ]]; then if type -p gpg >/dev/null 2>&1 = 1; then error "$(gettext "gnupg does not seem to be installed.")" msg2 "$(gettext "pacman-key requires gnupg for most operations.")" @@ -317,10 +321,10 @@ case "${command}" in ${GPG_PACMAN} "$@" || ret=$? exit $ret ;; - --help) + -h | --help) usage ;; - --version) + -v | --version) version exit 0 ;; -- cgit v1.2.3-70-g09d2