]> git.ipfire.org Git - thirdparty/man-pages.git/commitdiff
src/bin/grepc: Ignore shellcheck(1) diagnostics
authorAlejandro Colomar <alx@kernel.org>
Wed, 29 Oct 2025 21:01:59 +0000 (22:01 +0100)
committerAlejandro Colomar <alx@kernel.org>
Wed, 29 Oct 2025 21:14:12 +0000 (22:14 +0100)
Signed-off-by: Alejandro Colomar <alx@kernel.org>
src/bin/grepc

index 01f52235bdcb3e8374c08a2c25f347bec127991e..00b69937921e1aff3cd37a655365b375d5fc3ff6 100755 (executable)
@@ -52,6 +52,7 @@ grepc_err()
 
 
 while getopts "A:B:C:chilm:nrt:x:" opt; do
+       # shellcheck disable=SC2249  # getopts(1) uses '?' for an error.
        case "$opt" in
        A)      A="-A$OPTARG";  ;;&
        B)      B="-B$OPTARG";  ;;&
@@ -68,6 +69,7 @@ while getopts "A:B:C:chilm:nrt:x:" opt; do
                        x='c';
                fi;
 
+               # shellcheck disable=SC2249  # Already validated under x).
                case "$x" in
                c)
                        case "$OPTARG" in
@@ -237,6 +239,7 @@ if test -z "$*"; then
 else
        find "$@" -type f -print0 \
        | if test -z "$c"; then
+               # shellcheck disable=SC2248  # $i may be -i or nothing.
                xargs -0 grep -lZPI $i -- "$identifier";
        else
                cat;
@@ -244,6 +247,7 @@ else
        | xargs -0 pcre2grep "${opts[@]}" -f "$patterns";
 fi \
 | perl -p <(
+       # shellcheck disable=SC2312  # We don't care about failures here.
        test "$r" = 'yes' \
        && printf '%s\n' 's/('"$identifier"')/\033[32m\1\033[0m/' \
        || printf '%s\n' 's///';