mirror of
https://github.com/eth-p/bat-extras.git
synced 2024-12-14 02:00:40 +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
|
fi
|
||||||
|
|
||||||
# Error if no value is provided.
|
# 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"
|
printc "%{RED}%s: '%s' requires a value%{CLEAR}\n" "$PROGRAM" "$ARG"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
Loading…
Reference in New Issue
Block a user