]> git.ipfire.org Git - thirdparty/man-pages.git/commitdiff
bin/grepc: Simplify (remove grepc_search())
authorAlejandro Colomar <alx@kernel.org>
Fri, 3 Nov 2023 17:26:00 +0000 (18:26 +0100)
committerAlejandro Colomar <alx@kernel.org>
Wed, 29 Oct 2025 20:29:17 +0000 (21:29 +0100)
Signed-off-by: Alejandro Colomar <alx@kernel.org>
bin/grepc

index 6d70f99bc2b3e81b5bef38f25760732aa6c2a549..40460e123b33a78517d09ae7446af32dbe308a1f 100755 (executable)
--- a/bin/grepc
+++ b/bin/grepc
@@ -234,18 +234,14 @@ grepc_patterns()
 }
 
 
-grepc_search()
-{
-       pcre2grep -${iflag}${lflag}HMn --label="$file" -f <(grepc_patterns "$identifier") \
-       | 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///')";
-}
-
-
 main()
 {
        grepc_parse_cmd "$@" </dev/null;
-       grepc_search "$identifier" <"$file" \
+
+       <"$file" \
+       pcre2grep -${iflag}${lflag}HMn --label="$file" -f <(grepc_patterns "$identifier") \
+       | 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
                sort \
                | uniq;