Signed-off-by: Alejandro Colomar <alx@kernel.org>
i='';
k='no';
l='';
+n='';
t='no';
t_e='no';
t_fp='no';
grepc_parse_cmd()
{
- while getopts "A:B:C:chiklt:" opt; do
+ while getopts "A:B:C:chiklnt:" opt; do
case "$opt" in
A)
A="-A$OPTARG";
l='-l';
k='yes';
;;
+ n)
+ n='-n';
+ ;;
t)
case "$OPTARG" in
e)
opts="$opts $i";
opts="$opts $l";
opts="$opts -M";
- opts="$opts -n";
+ opts="$opts $n";
if test -z "$files"; then
pcre2grep $opts -f "$patterns";
from which output would normally have been printed.
Each file is only printed once.
.TP
+.B \-n
+Prefix each line of output with the
+1-based line number within its input file.
+.TP
.BI \-t " type"
Restrict the search to a specific
.I type
redirect it to the standard input.
.SH EXAMPLES
.EX
-.RB \(ti/src/nginx/unit$ " grepc nxt_sprintf .;"
+.RB \(ti/src/nginx/unit$ " grepc \-n nxt_sprintf .;"
\&
\&
\&./src/nxt_sprintf.h:15: