Remove dead code in PMDCommandLineInterface
This commit is contained in:
@ -41,12 +41,12 @@ public final class PMDCommandLineInterface {
|
||||
jcommander.parse(args);
|
||||
if (arguments.isHelp()) {
|
||||
jcommander.usage();
|
||||
System.out.println(buildUsageText(jcommander));
|
||||
System.out.println(buildUsageText());
|
||||
setStatusCodeOrExit(NO_ERRORS_STATUS);
|
||||
}
|
||||
} catch (ParameterException e) {
|
||||
jcommander.usage();
|
||||
System.out.println(buildUsageText(jcommander));
|
||||
System.out.println(buildUsageText());
|
||||
System.err.println(e.getMessage());
|
||||
setStatusCodeOrExit(ERROR_STATUS);
|
||||
}
|
||||
@ -54,19 +54,6 @@ public final class PMDCommandLineInterface {
|
||||
}
|
||||
|
||||
public static String buildUsageText() {
|
||||
return buildUsageText(null);
|
||||
}
|
||||
|
||||
public static String buildUsageText(JCommander jcommander) {
|
||||
StringBuilder usage = new StringBuilder();
|
||||
|
||||
StringBuilder allCommandsDescription = new StringBuilder();
|
||||
if (jcommander != null && jcommander.getCommands() != null) {
|
||||
for (String command : jcommander.getCommands().keySet()) {
|
||||
allCommandsDescription.append(jcommander.getCommandDescription(command)).append(PMD.EOL);
|
||||
}
|
||||
}
|
||||
|
||||
// TODO: Externalize that to a file available within the classpath ? -
|
||||
// with a poor's man templating ?
|
||||
String fullText = PMD.EOL + "Mandatory arguments:" + PMD.EOL + "1) A java source code filename or directory"
|
||||
@ -77,18 +64,17 @@ public final class PMDCommandLineInterface {
|
||||
|
||||
fullText += supportedVersions() + PMD.EOL;
|
||||
|
||||
if (allCommandsDescription.length() != 0) {
|
||||
fullText += "Optional arguments that may be put before or after the mandatory arguments: " + PMD.EOL
|
||||
+ allCommandsDescription + PMD.EOL;
|
||||
}
|
||||
|
||||
fullText += "Available report formats and their configuration properties are:" + PMD.EOL + getReports()
|
||||
+ PMD.EOL + getExamples() + PMD.EOL + PMD.EOL + PMD.EOL;
|
||||
|
||||
fullText += usage.toString();
|
||||
return fullText;
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public static String buildUsageText(JCommander jcommander) {
|
||||
return buildUsageText();
|
||||
}
|
||||
|
||||
private static String getExamples() {
|
||||
return getWindowsExample() + getUnixExample();
|
||||
}
|
||||
|
Reference in New Issue
Block a user