Add argument forwarding from batgrep to ripgrep

This commit is contained in:
Ethan P 2019-12-23 16:58:58 -08:00
parent f17681b8b8
commit 18bf6e2c5c
No known key found for this signature in database
GPG Key ID: 6963FD04F6CF35EA

View File

@ -77,6 +77,18 @@ while shiftopt; do
--no-snip) OPT_SNIP="";;
--no-highlight) OPT_HIGHLIGHT=false;;
# Option Forwarding
--rg:*) {
if [[ "${OPT:5:1}" = "-" ]]; then
RG_ARGS+=("${OPT:5}")
else
RG_ARGS+=("--${OPT:5}")
fi
if [[ -n "$OPT_VAL" ]]; then
RG_ARGS+=("$OPT_VAL")
fi
};;
# ???
-*) {
printc "%{RED}%s: unknown option '%s'%{CLEAR}\n" "$PROGRAM" "$OPT" 1>&2