fix one minor issue related to 'version'

This commit is contained in:
Liam
2021-11-03 09:21:25 -05:00
parent dfb83b369e
commit 3a8a9502de
2 changed files with 3 additions and 3 deletions

View File

@ -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.")

View File

@ -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();
}
/**