diff --git a/shellcheck.1.md b/shellcheck.1.md index abf2ff3..8671d1e 100644 --- a/shellcheck.1.md +++ b/shellcheck.1.md @@ -58,7 +58,7 @@ not warn at all, as `ksh` supports decimals in arithmetic contexts. **-S**\ *SEVERITY*,\ **--severity=***severity* -: Specify maximum severity of errors to consider. Valid values are *error*, +: Specify minimum severity of errors to consider. Valid values are *error*, *warning*, *info* and *style*. The default is *style*. **-s**\ *shell*,\ **--shell=***shell* diff --git a/shellcheck.hs b/shellcheck.hs index 52866ff..ef7eb24 100644 --- a/shellcheck.hs +++ b/shellcheck.hs @@ -68,7 +68,7 @@ data Options = Options { checkSpec :: CheckSpec, externalSources :: Bool, formatterOptions :: FormatterOptions, - maxSeverity :: Severity + minSeverity :: Severity } defaultOptions = Options { @@ -77,7 +77,7 @@ defaultOptions = Options { formatterOptions = FormatterOptions { foColorOption = ColorAuto }, - maxSeverity = StyleC + minSeverity = StyleC } usageHeader = "Usage: shellcheck [OPTIONS...] FILES..." @@ -97,7 +97,7 @@ options = [ "Specify dialect (sh, bash, dash, ksh)", Option "S" ["severity"] (ReqArg (Flag "severity") "SEVERITY") - "Maximum severity of errors to consider (error, warning, info, style)", + "Minimum severity of errors to consider (error, warning, info, style)", Option "V" ["version"] (NoArg $ Flag "version" "true") "Print version information", Option "x" ["external-sources"] @@ -282,7 +282,7 @@ parseOption flag options = Flag "severity" severity -> return options { checkSpec = (checkSpec options) { - csMaxSeverity = parseSeverityOption severity + csMinSeverity = parseSeverityOption severity } } diff --git a/src/ShellCheck/Checker.hs b/src/ShellCheck/Checker.hs index 23f60ba..dc17364 100644 --- a/src/ShellCheck/Checker.hs +++ b/src/ShellCheck/Checker.hs @@ -68,7 +68,7 @@ checkScript sys spec = do (parseMessages ++ map translator analysisMessages) shouldInclude (PositionedComment _ _ (Comment severity code _)) = - severity <= csMaxSeverity spec && + severity <= csMinSeverity spec && code `notElem` csExcludedWarnings spec sortMessages = sortBy (comparing order) diff --git a/src/ShellCheck/Interface.hs b/src/ShellCheck/Interface.hs index 5e475b0..a0b93f2 100644 --- a/src/ShellCheck/Interface.hs +++ b/src/ShellCheck/Interface.hs @@ -36,7 +36,7 @@ data CheckSpec = CheckSpec { csCheckSourced :: Bool, csExcludedWarnings :: [Integer], csShellTypeOverride :: Maybe Shell, - csMaxSeverity :: Severity + csMinSeverity :: Severity } deriving (Show, Eq) data CheckResult = CheckResult { @@ -51,7 +51,7 @@ emptyCheckSpec = CheckSpec { csCheckSourced = False, csExcludedWarnings = [], csShellTypeOverride = Nothing, - csMaxSeverity = StyleC + csMinSeverity = StyleC } newParseSpec :: ParseSpec