]> git.corax.cc Git - toolbox/commitdiff
include/inst: Silence shellcheck if unused variables are parameters
authorMatthias Kruk <m@m10k.eu>
Sat, 3 Dec 2022 07:17:28 +0000 (16:17 +0900)
committerMatthias Kruk <m@m10k.eu>
Sat, 3 Dec 2022 07:17:28 +0000 (16:17 +0900)
When scanning the `inst' module with shellcheck, warnings are issued
about unused variables. However, the unused variables are function
parameters, which have to be declared per toolbox convention.

This commit adds comments instructing shellcheck to ignore the
unused function parameters.

include/inst.sh

index 1ac60dd75650220e7d4cedd8042f976258e9d5b1..e5d51e2062384d8b12c947b9bebf5a5b16f20216 100644 (file)
@@ -45,6 +45,7 @@ __init() {
 }
 
 _inst_handle_opt_stop() {
+       # shellcheck disable=SC2034 # Reason: All function parameters must be declared (toolbox convention)
        local opt="$1"
        local arg="$2"
 
@@ -53,7 +54,9 @@ _inst_handle_opt_stop() {
 }
 
 _inst_handle_opt_list() {
+       # shellcheck disable=SC2034 # Reason: All function parameters must be declared (toolbox convention)
        local opt="$1"
+       # shellcheck disable=SC2034 # Reason: All function parameters must be declared (toolbox convention)
        local arg="$2"
 
        inst_list "$__inst_name"