You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The case statement handling getopts arguments does not have a default branch to handle unknown flags.
When a flag is not recognized, such as if passing -Z to the example code, getopts will set the variable to a literal question mark ?. This should be handled along with all the valid flags, usually by printing a usage message and exiting with failure.
Using a \?) or ?) case will also match invalid flags, but*) would additionally match things like the empty string if the variable name was misspelled.
Exceptions:
If your script's logic handles unrecognized flags in another way, e.g. after the case statement, you can ignore this warning.