Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
git='no';
ext='\.[ch]$';
FILES='.';
+kflag='no';
tflag='no';
t_enum='no';
t_func='no';
grepc_parse_cmd()
{
- while getopts "ght:x:" opt; do
+ while getopts "ghkt:x:" opt; do
case "$opt" in
g)
git='yes';
grepc_usage;
exit 0;
;;
+ k)
+ kflag='yes';
+ ;;
t)
case "$OPTARG" in
e)
| xargs grep -lP "$2" \
| sort \
| xargs pcregrep -Mn "$3" /dev/null \
- | sed -E 's/^[^: ]+:[0-9]+:/\n\n&\n/';
+ | if [ "$kflag" = 'no' ]; then
+ sed -E 's/^[^: ]+:[0-9]+:/\n\n&\n/';
+ else
+ cat;
+ fi;
}
grepc_parse_cmd $@;
grepc_find_files "$identifier";
grepc_search "$identifier" \
- | tail -n+3;
+ | sed -n '/./,$p';
}
.B \-h
Output a help message and exit.
.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
.BI \-t " type"
Restrict the search to a specific
.I type