From 103c7243a2d50dd46c0b5efefdc2e1b1d24e30e0 Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Tue, 29 May 2007 16:53:15 -0400 Subject: Get --help and --version options working on all scripts Added the autoconf option std-options to the scripts/ directory, which checks to ensure all programs have both --help and --version options. A few things needed cleaning up to get this working. To test these types of options, use the 'make distcheck' target. Signed-off-by: Dan McGee --- scripts/makepkg.in | 27 ++++++++++++++++++++++----- 1 file changed, 22 insertions(+), 5 deletions(-) (limited to 'scripts/makepkg.in') diff --git a/scripts/makepkg.in b/scripts/makepkg.in index 0d147041..2884e5db 100644 --- a/scripts/makepkg.in +++ b/scripts/makepkg.in @@ -600,7 +600,7 @@ installpackage() { } usage() { - printf "$(gettext "makepkg version %s")\n" "$myver" + printf "$(gettext "makepkg (pacman) %s")\n" "$myver" echo printf "$(gettext "Usage: %s [options]")\n" "$0" echo @@ -633,6 +633,15 @@ usage() { echo } +version() { + printf "$(gettext "makepkg (pacman) %s")\n" "$myver" + echo "$(gettext "Copyright (C) 2002-2007 Judd Vinet .")" + echo + echo "$(gettext "This is free software; see the source for copying conditions.")" + echo "$(gettext "There is NO WARRANTY, to the extent permitted by law.")" + echo +} + ARGLIST=$@ #preserve environment variables @@ -684,6 +693,10 @@ while [ "$#" -ne "0" ]; do usage exit 0 ;; + --version) + version + exit 0 + ;; --*) usage exit 1 @@ -699,10 +712,6 @@ while [ "$#" -ne "0" ]; do f) FORCE=1 ;; F) INFAKEROOT=1 ;; g) GENINTEG=1 ;; - h) - usage - exit 0 - ;; i) INSTALL=1 ;; L) LOGGING=1 ;; m) USE_COLOR="n" ;; @@ -712,6 +721,14 @@ while [ "$#" -ne "0" ]; do R) REPKG=1 ;; s) DEP_BIN=1 ;; S) SUDO=1 ;; + h) + usage + exit 0 + ;; + V) + version + exit 0 + ;; -) OPTIND=0 break -- cgit v1.2.3-24-g4f1b