From fe1aa1d16df8993e87eaf91be2c1eb88913ff0a0 Mon Sep 17 00:00:00 2001 From: Brandon Maier Date: Thu, 24 Oct 2024 13:27:59 -0500 Subject: [PATCH] lib/opts.sh: fix prefixes with embedded '-' If a `--prefix` path has an embedded '-', shiftval incorrectly detects it as a flag. --- lib/opt.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/opt.sh b/lib/opt.sh index cdc85ea..9012853 100644 --- a/lib/opt.sh +++ b/lib/opt.sh @@ -181,7 +181,7 @@ shiftval() { fi # Error if no value is provided. - if [[ "$OPT_VAL" =~ -.* ]]; then + if [[ "$OPT_VAL" =~ ^-.* ]]; then printc "%{RED}%s: '%s' requires a value%{CLEAR}\n" "$PROGRAM" "$ARG" exit 1 fi