The program name $0 is a global variable, there is no point in passing it to functions as a parameter.
Signed-off-by: Jean Delvare <[email protected]> Reviewed-by: Raphael Hertzog <[email protected]> --- quilt/scripts/backup-files.in | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) --- a/quilt/scripts/backup-files.in +++ b/quilt/scripts/backup-files.in @@ -27,8 +27,7 @@ set -e # name prefix for the backup files must be specified with the -B option. usage () { - local progname="$1" - echo "Usage: $progname [-B prefix] [-f {file|-}] [-s] [-k] [-t] [-L] [-b|-r|-x] {file|-} ... + echo "Usage: $0 [-B prefix] [-f {file|-}] [-s] [-k] [-t] [-L] [-b|-r|-x] {file|-} ... Create hard linked backup copies of a list of files read from standard input. @@ -172,7 +171,6 @@ walk() { ECHO=echo declare -a FILELIST -progname="$0" while [ $# -gt 0 ]; do case $1 in -b) OPT_WHAT=backup @@ -195,7 +193,7 @@ while [ $# -gt 0 ]; do ;; -t) OPT_TOUCH=1 ;; - -?*) usage "$progname" + -?*) usage exit 0 ;; *) FILELIST=("$@") @@ -207,7 +205,7 @@ while [ $# -gt 0 ]; do done if [ -z "$OPT_PREFIX" ]; then - usage "$progname" + usage exit 1 fi _______________________________________________ Quilt-dev mailing list [email protected] http://lists.nongnu.org/mailman/listinfo/quilt-dev
