]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
util/bash-completion: Disable SC2120 shellcheck warning
authort.feng <fengtao40@huawei.com>
Tue, 6 Dec 2022 13:49:31 +0000 (21:49 +0800)
committerDaniel Kiper <daniel.kiper@oracle.com>
Wed, 7 Dec 2022 22:38:27 +0000 (23:38 +0100)
SC2120 (warning): function references arguments, but none are ever passed.

In grub-completion.bash.in line 63:
__grub_get_options_from_help () {
^-- SC2120 (warning)
     local prog

     if [ $# -ge 1 ]; then
         prog="$1"

The arg of __grub_get_options_from_help() is optional. So, the current
code meets the exception and does not need to be modified. Ignoring the
warning then.

More: https://github.com/koalaman/shellcheck/wiki/SC2120

Signed-off-by: t.feng <fengtao40@huawei.com>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
util/bash-completion.d/grub-completion.bash.in

index a85f18f05b075c59d78d02f38687fd2c699779d8..213ce1e57cfecec6115e5409533da3e9135df975 100644 (file)
@@ -63,6 +63,7 @@ __grubcomp () {
 
 # Function that return long options from the help of the command
 # - arg: $1 (optional) command to get the long options from
+# shellcheck disable=SC2120
 __grub_get_options_from_help () {
      local prog