Add help information.
This commit is contained in:
11
countdown.sh
11
countdown.sh
@@ -24,9 +24,18 @@
|
|||||||
|
|
||||||
set -euo pipefail
|
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
|
then
|
||||||
echo "Usage: $0 [COUNT]"
|
echo "Usage: $0 [COUNT]"
|
||||||
|
exit 0
|
||||||
|
elif [ $# -eq 1 ] && [ "$1" -le 0 ]
|
||||||
|
then
|
||||||
|
echo "COUNT must be a positive integer"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user