tools - Fix return code in hammer-backup.sh
authorAntonio Huete Jimenez <tuxillo@quantumachine.net>
Thu, 13 Mar 2014 09:25:56 +0000 (10:25 +0100)
committerAntonio Huete Jimenez <tuxillo@quantumachine.net>
Thu, 13 Mar 2014 09:33:08 +0000 (10:33 +0100)
- When requesting help with '-h', exit with return code 0.

Submitted-by: Freddy DISSAUX
tools/tools/hammer-backup/hammer-backup.sh

index cd56b2e..8fe0b2f 100755 (executable)
@@ -82,9 +82,10 @@ err()
 
 usage()
 {
+    exitval=${1:-1}
     echo "Usage: ${SCRIPTNAME} [-hlvfk] [-i <full-backup-file|auto>]" \
        "[-c <compress-rate>] -d [<backup-dir>] [pfs path]"
-    exit 1
+    exit $exitval
 }
 
 check_pfs()
@@ -439,7 +440,7 @@ do
            verbose=1
            ;;
        h)
-           usage
+           usage 0
            ;;
        *)
            usage