mirror of
https://github.com/eth-p/bat-extras.git
synced 2024-12-13 09:40:42 +01:00
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:
parent
36c77c171c
commit
fe1aa1d16d
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user