]> git.pld-linux.org Git - packages/mdadm.git/commitdiff
- display usage when no args specified
authorArkadiusz Miśkiewicz <arekm@maven.pl>
Sun, 23 Nov 2008 13:00:32 +0000 (13:00 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
Changed files:
    mdadm-checkarray -> 1.2

mdadm-checkarray

index 7c387d88201cb9e5de7a63b1ea92517aa6a969ac..a67d97b09721b278fbc59632cd6173fad322d15b 100644 (file)
@@ -53,7 +53,14 @@ usage()
 SHORTOPTS=achVqQsx
 LONGOPTS=all,cron,help,version,quiet,real-quiet,status,cancel
 
-eval set -- $(getopt -o $SHORTOPTS -l $LONGOPTS -n $PROGNAME -- "$@")
+if [ $# -eq 0 ]; then
+       usage >&2
+       exit 0
+fi
+
+ARGS="$@"
+
+eval set -- $(getopt -o $SHORTOPTS -l $LONGOPTS -n $PROGNAME -- "$ARGS")
 
 arrays=''
 cron=0
@@ -62,7 +69,7 @@ quiet=0
 status=0
 action=check
 
-for opt in $@; do
+for opt in $ARGS; do
   case "$opt" in
     -a|--all) all=1;;
     -c|--cron) cron=1;;
This page took 0.123803 seconds and 4 git commands to generate.