mirror of
https://github.com/koalaman/shellcheck.git
synced 2025-10-03 19:29:44 +08:00
Updated SC2213 (markdown)
@@ -36,7 +36,7 @@ Either add a case to handle the flag, or remove it from the `getopts` option str
|
|||||||
|
|
||||||
ShellCheck may not correctly recognize less canonical uses of `while getopts ..; do case ..;`, such as when modifying the variable before using it:
|
ShellCheck may not correctly recognize less canonical uses of `while getopts ..; do case ..;`, such as when modifying the variable before using it:
|
||||||
|
|
||||||
```
|
```sh
|
||||||
while getopts "rf-:" OPT; do
|
while getopts "rf-:" OPT; do
|
||||||
if [ "$OPT" = "-" ]; then # long option: reformulate OPT and OPTARG
|
if [ "$OPT" = "-" ]; then # long option: reformulate OPT and OPTARG
|
||||||
OPT="${OPTARG%%=*}" # extract long option name
|
OPT="${OPTARG%%=*}" # extract long option name
|
||||||
|
Reference in New Issue
Block a user