From 684d6acc9382ec84d83580cd1f886c05647dd149 Mon Sep 17 00:00:00 2001 From: spacewander Date: Wed, 12 Apr 2017 23:38:15 +0800 Subject: [PATCH] git-standup: add sanity check to -d option and overwrite -w option --- bin/git-standup | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/bin/git-standup b/bin/git-standup index 0e62e76..6451599 100755 --- a/bin/git-standup +++ b/bin/git-standup @@ -73,7 +73,11 @@ while getopts "hgfd:a:w:m:D:L" opt; do ;; d) test -n "$SINCE" && warn "-d option is conflict with -w" - SINCE=${SINCE:="$OPTARG days ago"} + if [ "$OPTARG" -lt 1 ]; then + >&2 echo "Specify days less than one is invalid" + exit 1 + fi + SINCE="$OPTARG days ago" ;; w) if [ -n "$SINCE" ]; then