standalone: Add explicit -- for delimiting run args vs NAC3 args

This commit is contained in:
David Mak 2024-04-25 15:07:29 +08:00
parent baac348ee6
commit c4dc36ae99

View File

@ -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