Skip to content

Commit

Permalink
Refactored MainCLI.printHelp().
Browse files Browse the repository at this point in the history
The MainCLI.printHelp() has been modified to call CLI.printHelp()
which displays deprecated commands properly.

https://pagure.io/dogtagpki/issue/2536

Change-Id: I803c0bcf041624eb7e37b04db5f455337e73caed
  • Loading branch information
edewata committed Mar 15, 2018
1 parent cc8e517 commit 156f188
Showing 1 changed file with 1 addition and 17 deletions.
18 changes: 1 addition & 17 deletions base/java-tools/src/com/netscape/cmstools/cli/MainCLI.java
Original file line number Diff line number Diff line change
Expand Up @@ -139,23 +139,7 @@ public void printHelp() {
formatter.printHelp(name + " [OPTIONS..] <command> [ARGS..]", options);
System.out.println();

int leftPadding = 1;
int rightPadding = 25;

System.out.println("Commands:");

for (CLI module : modules.values()) {
String label = module.getFullName();

int padding = rightPadding - leftPadding - label.length();
if (padding < 1)
padding = 1;

System.out.print(StringUtils.repeat(" ", leftPadding));
System.out.print(label);
System.out.print(StringUtils.repeat(" ", padding));
System.out.println(module.getDescription());
}
super.printHelp();
}

public void createOptions() throws UnknownHostException {
Expand Down

0 comments on commit 156f188

Please sign in to comment.