From 5f5c24641e5c487f5471b2740fdd2cb1e7da2cd3 Mon Sep 17 00:00:00 2001 From: Ville Rantanen Date: Fri, 10 Jan 2020 12:25:13 +0200 Subject: [PATCH] basic help doc --- reporting/timer | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/reporting/timer b/reporting/timer index 1d98271..479dcb6 100755 --- a/reporting/timer +++ b/reporting/timer @@ -1,5 +1,18 @@ #!/bin/bash +function helpexit() { + echo "Simple Timer." + echo '$PREFIX is printed before the time' + echo '$POSTFIX is printed after the time' + exit +} + + +for (( i=1; i<=$#; i++ )); do + [[ "${!i}" = "--help" ]] && helpexit + [[ "${!i}" = "-h" ]] && helpexit +done + function displaytime { local T=$1 local D=$((T/60/60/24))