batgrep: Add short flag number parsing for context options

This commit is contained in:
Ethan P 2020-07-06 18:03:47 -07:00
parent e4999a7ffb
commit df5b237273
No known key found for this signature in database
GPG Key ID: 6963FD04F6CF35EA

View File

@ -53,10 +53,10 @@ while shiftopt; do
-i | --ignore-case) OPT_CASE_SENSITIVITY="--ignore-case" ;;
-s | --case-sensitive) OPT_CASE_SENSITIVITY="--case-sensitive" ;;
-S | --smart-case) OPT_CASE_SENSITIVITY="--smart-case" ;;
-A | --after-context) shiftval; OPT_CONTEXT_AFTER="$OPT_VAL" ;;
-B | --before-context) shiftval; OPT_CONTEXT_BEFORE="$OPT_VAL" ;;
-C | --context)
-A* | --after-context) shiftval; OPT_CONTEXT_AFTER="$OPT_VAL" ;;
-B* | --before-context) shiftval; OPT_CONTEXT_BEFORE="$OPT_VAL" ;;
-C* | --context)
shiftval
OPT_CONTEXT_BEFORE="$OPT_VAL"
OPT_CONTEXT_AFTER="$OPT_VAL"