summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlejandro Colomar <alx@kernel.org>2023-11-03 18:46:09 +0100
committerAlejandro Colomar <alx@kernel.org>2023-11-03 23:05:49 +0100
commit35ff99a8399b8f140c817d554b38eb37aecf544b (patch)
treeb4f43bd3dd13cb45b7ab9154c67a6eb7ee5cf572
parent2c92a03bf9c245866d199ae23057e5f2a8554a04 (diff)
bin/grepc: Don't use pcre2grep(1)'s --label
Signed-off-by: Alejandro Colomar <alx@kernel.org>
-rwxr-xr-xbin/grepc4
1 files changed, 1 insertions, 3 deletions
diff --git a/bin/grepc b/bin/grepc
index 40460e1..23c9e3c 100755
--- a/bin/grepc
+++ b/bin/grepc
@@ -2,7 +2,6 @@
# Defaults:
-file='/dev/stdin';
iflag='';
lflag='';
kflag='no';
@@ -238,8 +237,7 @@ main()
{
grepc_parse_cmd "$@" </dev/null;
- <"$file" \
- pcre2grep -${iflag}${lflag}HMn --label="$file" -f <(grepc_patterns "$identifier") \
+ pcre2grep -${iflag}${lflag}HMn -f <(grepc_patterns "$identifier") $file \
| sed -E -f <(test "$kflag" = 'no' && echo 's/^[^: ]+:[0-9]+:/\n\n&\n/') \
| perl -pe "$(test "$cflag" = 'yes' && echo 's/('"$identifier"')/\033[32m\1\033[0m/' || echo 's///')" \
| if [ -n "$lflag" ]; then