From 2307b08212504845da46bff3eecbd8642e18e755 Mon Sep 17 00:00:00 2001 From: Ian Kelling Date: Sun, 28 Jul 2019 20:02:41 -0400 Subject: [PATCH] better arg checking --- btrbk-run | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/btrbk-run b/btrbk-run index fa20061..3ec2221 100644 --- a/btrbk-run +++ b/btrbk-run @@ -150,9 +150,18 @@ while true; do esac done -# usefull commands are resume and archive +# only tested commands are resume and archive cmd_arg=${1:-run} +case $cmd_arg in + run|resume|archive) : ;; + *) die "untested command arg" ;; +esac + +if (( $# > 1 )); then + die: "only 1 nonoption arg is supported" +fi + if [[ -v targets && $source ]]; then die "error: -t and -s are mutually exclusive" fi -- 2.30.2