From 4240b99f84de34eab8f0ff4304b8d295762bc60f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=A1s=20Ortega=20Froysa?= Date: Mon, 2 Mar 2026 15:38:41 +0100 Subject: [PATCH] Add help information. --- countdown.sh | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) 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