]> git.ipfire.org Git - thirdparty/man-pages.git/commitdiff
Remove '-x' option
authorAlejandro Colomar <alx@kernel.org>
Thu, 2 Nov 2023 15:08:31 +0000 (16:08 +0100)
committerAlejandro Colomar <alx@kernel.org>
Wed, 29 Oct 2025 20:29:16 +0000 (21:29 +0100)
This program shouldn't know about file extensions.  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 7c030003c3b772a1693deeebba02c8085b1fd330..a3f31e44acb96c3b7b68dc0d7edc71775a9c3227 100755 (executable)
--- a/bin/grepc
+++ b/bin/grepc
@@ -3,7 +3,6 @@
 
 # Defaults:
 git='no';
-ext='\.[ch]$';
 FILES='.';
 iflag='';
 lflag='';
@@ -41,7 +40,7 @@ grepc_err()
 
 grepc_parse_cmd()
 {
-       while getopts "cghiklt:x:" opt; do
+       while getopts "cghiklt:" opt; do
                case "$opt" in
                c)
                        cflag='yes';
@@ -151,9 +150,6 @@ grepc_parse_cmd()
                        esac;
                        tflag='yes';
                        ;;
-               x)
-                       ext="$OPTARG";
-                       ;;
                ?)
                        exit 1;  # getopts(1) prints an error msg.
                        ;;
@@ -195,7 +191,6 @@ grepc_find_files()
        else
                find $FILES -type f;
        fi \
-       | grep -P -- "$ext" \
        | xargs grep -${iflag}lPI -- "$1" \
        | tee "$files_use" \
        | xargs grep -${iflag}lP -- "$1\b" \
index 3fd46b6c19bcbd8ec5b45076b8e6ee05aed10721..49a034d8bcf3ca00541833988ef402802e6cd0fb 100644 (file)
@@ -22,12 +22,6 @@ If
 .I file
 is a directory,
 the search is recursive within that directory.
-If
-.I file
-doesn't match a certain extension, it is skipped
-(see
-.B \-x
-in OPTIONS).
 If no
 .I file
 is given,
@@ -164,13 +158,6 @@ This option can be passed multiple times
 to search for various types of code.
 Default:
 .BR "e f m t" .
-.TP
-.BI \-x " extension"
-Restrict the search to files ending with
-.IR extension .
-It is interpreted as a PCRE pattern.
-Default:
-.BR \e.[ch]$ .
 .SH EXAMPLES
 .EX
 .RB \(ti/src/nginx/unit$ " grepc nxt_sprintf;"