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/updpkgsums.sh.in | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) (limited to 'contrib/updpkgsums.sh.in') diff --git a/contrib/updpkgsums.sh.in b/contrib/updpkgsums.sh.in index 4d35357f..0f52db4c 100644 --- a/contrib/updpkgsums.sh.in +++ b/contrib/updpkgsums.sh.in @@ -23,12 +23,16 @@ declare -r myname='updpkgsums' declare -r myver='@PACKAGE_VERSION@' usage() { - printf 'usage: %s [buildfile]\n\n' "$myname" - printf ' -h, --help display this help message and exit\n' - printf ' -V, --version display version information and exit\n\n' - printf '%s will perform an in place update the checksums in the\n' "$myname" - printf 'path specified by [buildfile], defaulting to PKGBUILD in the current\n' - printf 'working directory.\n' + printf "%s (pacman) v%s\n" "${myname}" "${myver}" + echo + printf "%s will perform an in place update of the checksums in the\n" "${myname}" + echo "path specified by [build file], defaulting to PKGBUILD in the current" + echo "working directory." + echo + printf "Usage: %s [build file]\n" "${myname}" + echo + echo " -h, --help display this help message and exit" + echo " -V, --version display version information and exit" } version() { @@ -43,7 +47,7 @@ esac buildfile=${1:-PKGBUILD} if [[ ! -f $buildfile ]]; then - printf '==> ERROR: %s not found or is not a file\n' "$buildfile" + printf "==> ERROR: %s not found or is not a file\n" "$buildfile" exit 1 fi -- cgit v1.2.3