shellcheck should recommend to use local OPTIND in case you parse the options with getopts and then call a different function that uses getopts again.
I don't know if shellcheck is sophisticated enough for such things, but it'd definitely be useful, that's not at all an obvious problem.
shellcheck should recommend to use
local OPTINDin case you parse the options with getopts and then call a different function that uses getopts again.I don't know if shellcheck is sophisticated enough for such things, but it'd definitely be useful, that's not at all an obvious problem.