]> git.ipfire.org Git - thirdparty/man-pages.git/commitdiff
Remove '-g' option
authorAlejandro Colomar <alx@kernel.org>
Thu, 2 Nov 2023 15:11:45 +0000 (16:11 +0100)
committerAlejandro Colomar <alx@kernel.org>
Wed, 29 Oct 2025 20:29:16 +0000 (21:29 +0100)
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>
bin/grepc
share/man/man1/grepc.1

index a3f31e44acb96c3b7b68dc0d7edc71775a9c3227..e0dd5cf05e68de7308e72f344054840fa9452598 100755 (executable)
--- a/bin/grepc
+++ b/bin/grepc
@@ -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" \
index 49a034d8bcf3ca00541833988ef402802e6cd0fb..2d9e8ddfe0324baead86e0b5512268c644bab378 100644 (file)
@@ -129,9 +129,6 @@ Only uses
 .RB ( u\fI*\fP )
 are highlighted.
 .TP
-.B \-g
-Restrict the search to files tracked by git.
-.TP
 .B \-h
 Output a help message and exit.
 .TP
@@ -186,7 +183,6 @@ Originally written by
 Alejandro Colomar
 .ME .
 .SH SEE ALSO
-.MR git-ls-files 1 ,
 .MR pcre2grep 1 ,
 .MR pcresyntax 3 ,
 .MR pcrepattern 3