From 80de5641a347cc5479f3441fc355e18d0310cde1 Mon Sep 17 00:00:00 2001 From: tiyn Date: Thu, 26 Oct 2023 04:38:53 +0200 Subject: [PATCH] tools: added error handler to timer --- .local/bin/tools/timer | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.local/bin/tools/timer b/.local/bin/tools/timer index 24b0e16..a37c049 100755 --- a/.local/bin/tools/timer +++ b/.local/bin/tools/timer @@ -36,10 +36,17 @@ stopwatch() { done } +no_args="true" while getopts "c:sh" arg; do case $arg in c) countdown $OPTARG;; s) stopwatch;; h) echo "$help";; + *) echo "$help";; esac + no_args="false" done + +if [ "$no_args" = "true" ]; then + echo "$help" +fi