From c4dc36ae997b5964c77f4522b36f53ec2a04c9d3 Mon Sep 17 00:00:00 2001 From: David Mak Date: Thu, 25 Apr 2024 15:07:29 +0800 Subject: [PATCH] standalone: Add explicit `--` for delimiting run args vs NAC3 args --- nac3standalone/demo/run_demo.sh | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/nac3standalone/demo/run_demo.sh b/nac3standalone/demo/run_demo.sh index 670c3ce8..68132545 100755 --- a/nac3standalone/demo/run_demo.sh +++ b/nac3standalone/demo/run_demo.sh @@ -10,6 +10,10 @@ fi declare -a nac3args while [ $# -ge 1 ]; do case "$1" in + --help) + echo "Usage: run_demo.sh [--help] [--out OUTFILE] [--lli] [--debug] -- [NAC3ARGS...]" + exit + ;; --out) shift outfile="$1" @@ -20,13 +24,22 @@ while [ $# -ge 1 ]; do --debug) debug=1 ;; + --) + shift + break + ;; *) - nac3args+=("$1") + break ;; esac shift done +while [ $# -ge 1 ]; do + nac3args+=("$1") + shift +done + if [ -n "$debug" ] && [ -e ../../target/debug/nac3standalone ]; then nac3standalone=../../target/debug/nac3standalone elif [ -e ../../target/release/nac3standalone ]; then