| Modifier and Type | Field and Description |
|---|---|
| private final JCommander |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public void | appendAllParametersDetails(StringBuilder
the builder to append to out, int the amount of indentation to apply indentCount, String the indentation indent, List<ParameterDescription> the parameters to append to the builder sortedParameters)Appends the details of all parameters in the given order to the argument string builder, indenting every line with indentCount-many indent. |
| public void | appendCommands(StringBuilder
the builder to append to out, int the amount of indentation to apply indentCount, int the indentation for the description descriptionIndent, String the indentation indent)Appends the details of all commands to the argument string builder, indenting every line with indentCount-many indent. |
| public void | appendMainLine(StringBuilder
the builder to append to out, boolean if the options section should be appended hasOptions, boolean if the comments section should be appended hasCommands, int the amount of indentation to apply indentCount, String the indentation indent)Appends the main line segment of the usage to the argument string builder, indenting every line with indentCount-many indent. |
| public String | Returns: the description of the command.the name of the command to get the description for commandName)Implements com. |
| public static String | Returns: the internationalized version of the string if available, otherwise it returns defReturns the internationalized version of the string if available, otherwise it returns def. |
| private static String | Returns: new line followed by indent-many spacesReturns new line followed by indent-many spaces. |
| public static String | |
| public final void | usage(String commandName)
Implements com. JCommander#getConsole() on the underlying commander instance.
|
| public final void | usage(String commandName, StringBuilder out)
Implements com. |
| public final void | usage(StringBuilder out)
Implements com. |
| public final void | usage(String commandName, StringBuilder out, String indent)
Implements com. |
| public void | usage(StringBuilder out, String indent)
Implements com. |
| public void | wrapDescription(StringBuilder
the output out, int the indentation in spaces for lines after the first line. indent, int the length of the indentation of the initial line currentLineIndent, String the text to wrap. No extra spaces are inserted before description)description. If the first line needs to be indented prepend the
correct number of spaces to description.Wrap a potentially long line to the value obtained by calling |
| public void | wrapDescription(StringBuilder
the output out, int the indentation in spaces for lines after the first line. indent, String the text to wrap. No extra spaces are inserted before description)description. If the first line needs to be indented prepend the
correct number of spaces to description.Wrap a potentially long line to { @link #commander#getColumnSize()}. |
| commander | back to summary |
|---|---|
| private final JCommander commander | |
| DefaultUsageFormatter | back to summary |
|---|---|
| public DefaultUsageFormatter(JCommander commander) | |
| appendAllParametersDetails | back to summary |
|---|---|
| public void appendAllParametersDetails(StringBuilder out, int indentCount, String indent, List<ParameterDescription> sortedParameters) Appends the details of all parameters in the given order to the argument string builder, indenting every line with indentCount-many indent.
| |
| appendCommands | back to summary |
|---|---|
| public void appendCommands(StringBuilder out, int indentCount, int descriptionIndent, String indent) Appends the details of all commands to the argument string builder, indenting every line with
indentCount-many indent. The commands are obtained from calling
| |
| appendMainLine | back to summary |
|---|---|
| public void appendMainLine(StringBuilder out, boolean hasOptions, boolean hasCommands, int indentCount, String indent) Appends the main line segment of the usage to the argument string builder, indenting every line with indentCount-many indent.
| |
| getCommandDescription | back to summary |
|---|---|
| public String getCommandDescription(String commandName) Implements com. Returns the description of the command corresponding to the argument command name. The commands are resolved
by calling | |
| getI18nString | back to summary |
|---|---|
| public static String getI18nString(ResourceBundle bundle, String key, String def) Returns the internationalized version of the string if available, otherwise it returns def.
| |
| newLineAndIndent | back to summary |
|---|---|
| private static String newLineAndIndent(int indent) Returns new line followed by indent-many spaces.
| |
| s | back to summary |
|---|---|
| public static String s(int count) Returns count-many spaces.
| |
| usage | back to summary |
|---|---|
| public final void usage(String commandName) Implements com. Prints the usage to | |
| usage | back to summary |
|---|---|
| public final void usage(String commandName, StringBuilder out) Implements com. Store the usage for the argument command in the argument string builder. | |
| usage | back to summary |
|---|---|
| public final void usage(StringBuilder out) Implements com. Store the usage in the argument string builder. | |
| usage | back to summary |
|---|---|
| public final void usage(String commandName, StringBuilder out, String indent) Implements com. Store the usage for the command in the argument string builder, indenting every line with the value of indent. | |
| usage | back to summary |
|---|---|
| public void usage(StringBuilder out, String indent) Implements com. Stores the usage in the argument string builder, with the argument indentation. This works by appending each portion of the help in the following order. Their outputs can be modified by overriding them in a subclass of this class. | |
| wrapDescription | back to summary |
|---|---|
| public void wrapDescription(StringBuilder out, int indent, int currentLineIndent, String description) Wrap a potentially long line to the value obtained by calling
| |
| wrapDescription | back to summary |
|---|---|
| public void wrapDescription(StringBuilder out, int indent, String description) Wrap a potentially long line to { @link #commander#getColumnSize()}.
| |