Add help information.
This commit is contained in:
11
countdown.sh
11
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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user