mirror of
https://github.com/koalaman/shellcheck.git
synced 2025-10-03 19:29:44 +08:00
Updated SC2221 (markdown)
@@ -21,7 +21,7 @@ esac
|
||||
```
|
||||
### Rationale:
|
||||
|
||||
You have specified multiple patterns in a `case` statement, where one will always override the other.
|
||||
You have specified multiple patterns in a `case` statement, where one will always override the other. The pattern being overridden is indicated with a [[SC2222]] warning.
|
||||
|
||||
In the example, `-?` actually matches a dash followed by any character, such as `-n`. This means that the later `-n` branch will never trigger. In this case, the correct solution is to escape the `-\?` so that it doesn't match `-n`.
|
||||
|
||||
|
Reference in New Issue
Block a user