+

add -h/--help parameter

Benjamin Renard [2012-03-22 16:53:16]
add -h/--help parameter
Filename
run-all-backup
diff --git a/run-all-backup b/run-all-backup
index c4d7879..0c9e7dc 100755
--- a/run-all-backup
+++ b/run-all-backup
@@ -9,10 +9,12 @@ DEBUG=0

 function usage() {
 	[ -n "$1" ] && echo "[ERROR] $1" > /dev/stderr && echo
-	echo "usage : $0 [incr|FULL] [-d]"
+	echo "usage : $0 [-h|--help] [incr|FULL] [-d]"
 	[ -n "$1" ] && exit 1 || exit 0
 }

+[ "$TYPE" == "-h" -o "$TYPE" == "--help" ] && usage
+
 [ ! -n "$TYPE" ] && TYPE=full

 if [ "$TYPE" == "incr" -o "$TYPE" == "INCR" ]
ViewGit