mirror of
https://github.com/koalaman/shellcheck.git
synced 2025-08-08 06:59:39 +08:00
Merge branch 'issue_837_opposite_of_exclude_option' of https://github.com/Gandalf-/shellcheck
This commit is contained in:
@@ -88,6 +88,8 @@ options = [
|
||||
Option "C" ["color"]
|
||||
(OptArg (maybe (Flag "color" "always") (Flag "color")) "WHEN")
|
||||
"Use color (auto, always, never)",
|
||||
Option "i" ["include"]
|
||||
(ReqArg (Flag "include") "CODE1,CODE2..") "Consider only given types of warnings",
|
||||
Option "e" ["exclude"]
|
||||
(ReqArg (Flag "exclude") "CODE1,CODE2..") "Exclude types of warnings",
|
||||
Option "f" ["format"]
|
||||
@@ -272,6 +274,18 @@ parseOption flag options =
|
||||
}
|
||||
}
|
||||
|
||||
Flag "include" str -> do
|
||||
new <- mapM parseNum $ filter (not . null) $ split ',' str
|
||||
let old = csIncludedWarnings . checkSpec $ options
|
||||
return options {
|
||||
checkSpec = (checkSpec options) {
|
||||
csIncludedWarnings =
|
||||
if null new
|
||||
then old
|
||||
else Just new `mappend` old
|
||||
}
|
||||
}
|
||||
|
||||
Flag "version" _ -> do
|
||||
liftIO printVersion
|
||||
throwError NoProblems
|
||||
|
Reference in New Issue
Block a user