]> git.ipfire.org Git - thirdparty/man-pages.git/commitdiff
bin/grepc, grepc.1: -k: Remove flag
authorAlejandro Colomar <alx@kernel.org>
Thu, 19 Sep 2024 12:12:57 +0000 (14:12 +0200)
committerAlejandro Colomar <alx@kernel.org>
Wed, 29 Oct 2025 20:29:27 +0000 (21:29 +0100)
Just behave like grep(1) and pcre2grep(1).  If the user wants to see it
more nicely, they can do it themselves.

Signed-off-by: Alejandro Colomar <alx@kernel.org>
bin/grepc
share/man/man1/grepc.1

index dd613e0a1a5da68e94f2cfb19c6e65abcf0b08e0..b5aff6951236a2ed739b3be9f5e51dc6f480f8c0 100755 (executable)
--- a/bin/grepc
+++ b/bin/grepc
@@ -8,7 +8,6 @@ C='';
 c='';
 h='-H';
 i='';
-k='no';
 l='';
 m='';
 n='';
@@ -47,7 +46,7 @@ grepc_err()
 }
 
 
-while getopts "A:B:C:chiklm:nrt:x:" opt; do
+while getopts "A:B:C:chilm:nrt:x:" opt; do
        case "$opt" in
        A)      A="-A$OPTARG";  ;;&
        B)      B="-B$OPTARG";  ;;&
@@ -55,7 +54,6 @@ while getopts "A:B:C:chiklm:nrt:x:" opt; do
        c)      c='-c';         ;;&
        h)      h='-h';         ;;&
        i)      i='-i';         ;;&
-       k | l)  k='yes';        ;;&
        l)      l='-l';         ;;&
        m)      m="-m$OPTARG";  ;;&
        n)      n='-n';         ;;&
@@ -239,7 +237,6 @@ else
        fi \
        | xargs pcre2grep "${opts[@]}" -f "$patterns";
 fi \
-| sed -E -f <(test "$k" = 'no' && printf '%s\n' 's/^[^: ]+:[0-9]+:/\n\n&\n/') \
 | perl -pe "$(test "$r" = 'yes' && printf '%s\n' 's/('"$identifier"')/\033[32m\1\033[0m/' || printf '%s\n' 's///')" \
 | if [ -n "$l" ]; then
        sort \
index fd2c8e13563d612c0050070e21df79313a9592c6..60316ae64ccc9f006e9a9cc3987e2cd8d0187366 100644 (file)
@@ -148,11 +148,6 @@ Suppress the prefixing of file names on output.
 Ignore case distinctions in
 .IR pattern .
 .TP
-.B \-k
-Compact (kurz) output.
-Don't print extra newlines
-(the header is printed in the same line as the first line of a match).
-.TP
 .B \-l
 Suppress normal output;
 instead print the name of each input file
@@ -197,15 +192,9 @@ redirect it to the standard input.
 .SH EXAMPLES
 .EX
 .RB \(ti/src/nginx/unit$ " grepc \-n nxt_sprintf .;"
-\&
-\&
-\&./src/nxt_sprintf.h:15:
-NXT_EXPORT u_char *nxt_cdecl nxt_sprintf(u_char *buf, u_char *end,
+\&./src/nxt_sprintf.h:15:NXT_EXPORT u_char *nxt_cdecl nxt_sprintf(u_char *buf, u_char *end,
     const char *fmt, ...);
-\&
-\&
-\&./src/nxt_sprintf.c:58:
-u_char * nxt_cdecl
+\&./src/nxt_sprintf.c:58:u_char * nxt_cdecl
 nxt_sprintf(u_char *buf, u_char *end, const char *fmt, ...)
 {
     u_char   *p;