git-commit: add an early check for -o
authorDenis Ovsienko <denis@ovsienko.info>
Tue, 8 Jan 2019 22:54:26 +0000 (22:54 +0000)
committerDenis Ovsienko <denis@ovsienko.info>
Tue, 8 Jan 2019 22:58:40 +0000 (22:58 +0000)
gateways/git-commit

index 3c7a556..dfa5bc5 100755 (executable)
@@ -162,7 +162,15 @@ while getopts u:r:o:f:m:a:d:v:h opt; do
                REPODIR="$OPTARG"
                ;;
        o)
-               ONLYRUN="$OPTARG"
+               case "$OPTARG" in
+               pull|commit|push|full)
+                       ONLYRUN="$OPTARG"
+                       ;;
+               *)
+                       echo "$THISFILE: '$OPTARG' is not a valid value for -$opt"
+                       usage_and_exit
+                       ;;
+               esac
                ;;
        f)
                FILEPATH="$OPTARG"