mirror of
https://github.com/koalaman/shellcheck
synced 2025-07-13 00:23:20 -07:00
Simplify warnRedundant
This commit is contained in:
parent
cfa2a663af
commit
ed331b816b
1 changed files with 4 additions and 4 deletions
|
@ -878,10 +878,10 @@ checkWhileGetoptsCase = CommandCheck (Exactly "getopts") f
|
|||
warnUnhandled optId caseId str =
|
||||
warn caseId 2213 $ "getopts specified -" ++ str ++ ", but it's not handled by this 'case'."
|
||||
|
||||
warnRedundant (key, expr) = sequence_ $ do
|
||||
str <- key
|
||||
guard $ str `notElem` ["*", ":", "?"]
|
||||
return $ warn (getId expr) 2214 "This case is not specified by getopts."
|
||||
warnRedundant (Just str, expr)
|
||||
| str `notElem` ["*", ":", "?"] =
|
||||
warn (getId expr) 2214 "This case is not specified by getopts."
|
||||
warnRedundant _ = return ()
|
||||
|
||||
getHandledStrings (_, globs, _) =
|
||||
map (\x -> (literal x, x)) globs
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue