diff options
author | Alejandro Colomar <alx@kernel.org> | 2023-11-03 18:26:00 +0100 |
---|---|---|
committer | Alejandro Colomar <alx@kernel.org> | 2023-11-03 23:05:49 +0100 |
commit | 2c92a03bf9c245866d199ae23057e5f2a8554a04 (patch) | |
tree | 23f9b97eb63b66f39709a833cacc54d933d10319 | |
parent | 279c73069f3c424768668aa8924d03a265ff4514 (diff) |
bin/grepc: Simplify (remove grepc_search())
Signed-off-by: Alejandro Colomar <alx@kernel.org>
-rwxr-xr-x | bin/grepc | 14 |
1 files changed, 5 insertions, 9 deletions
@@ -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; |