quilt-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Quilt-dev] [PATCH 08/39] backup-files: Drop variable progname


From: Jean Delvare
Subject: [Quilt-dev] [PATCH 08/39] backup-files: Drop variable progname
Date: Sat, 19 Mar 2011 10:52:38 +0100
User-agent: quilt/0.48-17.1

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 <address@hidden>
Reviewed-by: Raphael Hertzog <address@hidden>
---
 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
 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]