]> git.treefish.org Git - backmeupscotty.git/commitdiff
Added helptext.
authorAlexander Schmidt <alex@treefish.org>
Wed, 30 Jul 2014 09:21:41 +0000 (11:21 +0200)
committerAlexander Schmidt <alex@treefish.org>
Wed, 30 Jul 2014 09:21:41 +0000 (11:21 +0200)
backmeupscotty

index b3c270389a19cef8603d81a8fb9a4a9a638f88f0..257c1927d12c0be291a98268e3f7071d01dc35a6 100644 (file)
@@ -135,8 +135,19 @@ function cleanup_normal {
     scottyinfo "No cleanup_normal function was defined."
 }
 
+function printhelp {
+    cat <<EOF
+Usage: $(basename $0) [OPTION]...
+
+Recognized options:
+  -q   Only output errors
+  -n   Run only on nth day
+  -h   Print out this help
+EOF
+}
+
 function backmeupscotty {
-    while getopts "qn:" opt; do
+    while getopts "qn:h" opt; do
        case $opt in
            q)
                exec > /dev/null
@@ -144,9 +155,13 @@ function backmeupscotty {
            n)
                BACKUP_RUNEVERYNTHDAY=$OPTARG
                ;;
+           h)
+               printhelp
+                exit 0
+                ;;
        esac
     done
-
+    
     if ! isIncompleteOrNthDay; then
        scottyinfo "This is not the nth day and no incomplete backup exists."
        exit 0