diff --git a/pmd-core/src/main/java/net/sourceforge/pmd/cli/PMDParameters.java b/pmd-core/src/main/java/net/sourceforge/pmd/cli/PMDParameters.java index 4ffc360833..e5e86e9bfd 100644 --- a/pmd-core/src/main/java/net/sourceforge/pmd/cli/PMDParameters.java +++ b/pmd-core/src/main/java/net/sourceforge/pmd/cli/PMDParameters.java @@ -98,7 +98,7 @@ public class PMDParameters { @Parameter(names = { "--use-version", "-version", "-v" }, description = "Specify version of a language PMD should use.") private String version = null; - @Parameter(names = "--version", description = "Display current version of PMD.") + @Parameter(names = "--version", description = "Display current version of PMD.", help = true) private boolean currentVersion = false; @Parameter(names = { "--language", "-language", "-l" }, description = "Specify a language PMD should use.") diff --git a/pmd-core/src/main/java/net/sourceforge/pmd/cli/PmdParametersParseResult.java b/pmd-core/src/main/java/net/sourceforge/pmd/cli/PmdParametersParseResult.java index 572b84951a..77cbfad831 100644 --- a/pmd-core/src/main/java/net/sourceforge/pmd/cli/PmdParametersParseResult.java +++ b/pmd-core/src/main/java/net/sourceforge/pmd/cli/PmdParametersParseResult.java @@ -41,7 +41,7 @@ public final class PmdParametersParseResult { * In this case no configuration is produced. */ public boolean isHelp() { - return !isError() && result.isHelp(); + return !isError() && result.isHelp() && !result.isVersion(); } /** @@ -49,7 +49,7 @@ public final class PmdParametersParseResult { * In this case no configuration is produced. */ public boolean isVersion() { - return result.isVersion(); + return !isError() && result.isHelp() && result.isVersion(); } /**