aboutsummaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
Diffstat (limited to 'bin')
-rw-r--r--bin/chc.sh7
1 files changed, 7 insertions, 0 deletions
diff --git a/bin/chc.sh b/bin/chc.sh
index 8b15317c..ee030f5f 100644
--- a/bin/chc.sh
+++ b/bin/chc.sh
@@ -1,5 +1,12 @@
# Cache the output of a command and emit it straight from the cache if not
# expired on each run
+self=chc
+
+# Check arguments for sanity
+if [ "$#" -lt 3 ] ; then
+ printf >&2 '%s: Need a cache path, a duration, and a command\n' "$self"
+ exit 2
+fi
# First argument is the cache path, second is the duration in seconds
cac=$1 dur=$2