git-standup: add sanity check to -d option and overwrite -w option

This commit is contained in:
spacewander 2017-04-12 23:38:15 +08:00
parent 0b91cd9bae
commit 684d6acc93

View file

@ -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