| | |
| | | * The subcommand for which to display the usage information. |
| | | */ |
| | | public void getSubCommandUsage(StringBuilder buffer, SubCommand subCommand) { |
| | | setUsageOrVersionDisplayed(true); |
| | | String scriptName = System.getProperty(PROPERTY_SCRIPT_NAME); |
| | | if (scriptName == null || scriptName.length() == 0) { |
| | | scriptName = "java " + getMainClassName(); |
| | |
| | | public String getUsage() { |
| | | final StringBuilder buffer = new StringBuilder(); |
| | | |
| | | setUsageOrVersionDisplayed(true); |
| | | if (subCommand == null) { |
| | | if (System.getProperty("org.forgerock.opendj.gendoc") != null) { |
| | | // Generate reference documentation for dsconfig subcommands |
| | | for (SubCommand s : subCommands.values()) { |
| | | buffer.append(toRefSect2(s)); |
| | | } |
| | | generateReferenceDoc(buffer, subCommands.values()); |
| | | } else if (usageGroupArguments.size() > 1) { |
| | | // We have sub-command groups, so don't display any |
| | | // sub-commands by default. |
| | |
| | | writeToUsageOutputStream(buffer); |
| | | } |
| | | |
| | | /** |
| | | * Appends complete usage information for the specified set of sub-commands. |
| | | */ |
| | | /** Appends complete usage information for the specified set of sub-commands. */ |
| | | private void getFullUsage(Collection<SubCommand> c, boolean showGlobalOptions, StringBuilder buffer) { |
| | | setUsageOrVersionDisplayed(true); |
| | | |
| | | final LocalizableMessage toolDescription = getToolDescription(); |
| | | if (toolDescription != null && toolDescription.length() > 0) { |
| | | buffer.append(wrapText(toolDescription, MAX_LINE_WIDTH - 1)); |
| | |
| | | } |
| | | } |
| | | |
| | | /** Generate reference documentation for dsconfig subcommands. */ |
| | | private void generateReferenceDoc(final StringBuilder buffer, Collection<SubCommand> values) { |
| | | for (SubCommand s : values) { |
| | | buffer.append(toRefSect2(s)); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * Generate reference documentation for dsconfig subcommands in DocBook 5 XML format. As the number of categories is |
| | | * large, the subcommand entries are sorted here by name for inclusion in a <refsect1> covering all dsconfig |