diff --git a/countdown.sh b/countdown.sh index ffea337..ce468b4 100755 --- a/countdown.sh +++ b/countdown.sh @@ -24,9 +24,18 @@ set -euo pipefail -if [ $? -gt 1 ] +if [ $# -gt 1 ] +then + echo "Too many arguments" + echo "Usage: $0 [COUNT]" + exit 1 +elif [ $# -eq 1 ] && [ "$1" = "-h" ] then echo "Usage: $0 [COUNT]" + exit 0 +elif [ $# -eq 1 ] && [ "$1" -le 0 ] +then + echo "COUNT must be a positive integer" exit 1 fi