diff options
author | Alejandro Colomar <alx@kernel.org> | 2023-11-02 16:11:45 +0100 |
---|---|---|
committer | Alejandro Colomar <alx@kernel.org> | 2023-11-03 22:49:45 +0100 |
commit | 824733e33015d716bf1ae35f703288721a86f2dc (patch) | |
tree | 44ad6d34824183d413be71b033ad5944457290f6 /bin | |
parent | 0fb070c70e24ca4c418b8a552d8cfb36ce005a39 (diff) |
Remove '-g' option
This program shouldn't know about file names. If that is wanted, use
something like `find ... | grep ... | xargs grepc ...`.
Signed-off-by: Alejandro Colomar <alx@kernel.org>
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/grepc | 12 |
1 files changed, 2 insertions, 10 deletions
@@ -2,7 +2,6 @@ # Defaults: -git='no'; FILES='.'; iflag=''; lflag=''; @@ -40,14 +39,11 @@ grepc_err() grepc_parse_cmd() { - while getopts "cghiklt:" opt; do + while getopts "chiklt:" opt; do case "$opt" in c) cflag='yes'; ;; - g) - git='yes'; - ;; h) echo "Usage: $0 [OPTION ...] IDENTIFIER [FILE ...]"; exit 0; @@ -186,11 +182,7 @@ grepc_parse_cmd() grepc_find_files() { - if [ "$git" = 'yes' ]; then - git ls-files $FILES; - else - find $FILES -type f; - fi \ + find $FILES -type f \ | xargs grep -${iflag}lPI -- "$1" \ | tee "$files_use" \ | xargs grep -${iflag}lP -- "$1\b" \ |