lib/opts.sh: fix prefixes with embedded '-'

If a `--prefix` path has an embedded '-', shiftval incorrectly detects
it as a flag.
This commit is contained in:
Brandon Maier 2024-10-24 13:27:59 -05:00
parent 36c77c171c
commit fe1aa1d16d

View File

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