mirror of
https://github.com/eth-p/bat-extras.git
synced 2025-06-20 11:47:43 +02:00
batgrep: handle -u flag to ripgrep
This commit is contained in:
parent
8ad00bd978
commit
69792e95da
@ -64,11 +64,29 @@ if [[ -n "$RIPGREP_CONFIG_PATH" && -e "$RIPGREP_CONFIG_PATH" ]]; then
|
||||
fi
|
||||
|
||||
# Parse arguments.
|
||||
shopt -s extglob # Needed to handle -u
|
||||
|
||||
# First handle -u specially - it can be repeated multiple times in a single
|
||||
# short argument, and repeating it 1, 2, or 3 times causes different effects.
|
||||
resetargs
|
||||
SHIFTOPT_SHORT_OPTIONS="PASS"
|
||||
while shiftopt; do
|
||||
case "$OPT" in
|
||||
[-]+(u) )
|
||||
RG_ARGS+=("$OPT")
|
||||
;;
|
||||
esac
|
||||
done
|
||||
resetargs
|
||||
SHIFTOPT_SHORT_OPTIONS="VALUE"
|
||||
while shiftopt; do
|
||||
case "$OPT" in
|
||||
|
||||
# ripgrep options
|
||||
[-]+([u]) ) ;; # Ignore - handled in first loop.
|
||||
--unrestricted)
|
||||
RG_ARGS+=("$OPT")
|
||||
;;
|
||||
-i | --ignore-case) OPT_CASE_SENSITIVITY="--ignore-case" ;;
|
||||
-s | --case-sensitive) OPT_CASE_SENSITIVITY="--case-sensitive" ;;
|
||||
-S | --smart-case) OPT_CASE_SENSITIVITY="--smart-case" ;;
|
||||
|
Loading…
x
Reference in New Issue
Block a user