| Modifier and Type | Field and Description |
|---|---|
| public static final String | DEFAULT_ARG_NAME
default name for an argument |
| public static final int | DEFAULT_DESC_PAD
number of space characters to be prefixed to each description line |
| public static final int | DEFAULT_LEFT_PAD
default padding to the left of each line |
| public static final String | DEFAULT_LONG_OPT_PREFIX
default prefix for long Option |
| public static final String | DEFAULT_LONG_OPT_SEPARATOR
default separator displayed between a long Option and its value |
| public static final String | DEFAULT_OPT_PREFIX
default prefix for shortOpts |
| public static final String | DEFAULT_USAGE_PREFIX
the string to display at the beginning of the usage statement |
| public static final int | DEFAULT_WIDTH
default number of characters per line |
| private String | |
| private String | |
| private String | |
| private int | |
| private int | |
| private String | |
| private String | |
| protected Comparator | optionComparator
Comparator used to sort the options when they output in help text Defaults to case-insensitive alphabetical sorting by option key. |
| private String | |
| private int |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| protected void | appendArgument(StringBuilder
the StringBuilder to append to buff, Argument the argument to add argument, boolean whether the Option is required or not required)Appends the usage clause for an Argument to a StringBuilder. |
| protected void | appendOption(StringBuilder
the StringBuilder to append to buff, Option the Option to append option)Appends the usage clause for an Option to a StringBuilder. |
| public void | buildWrapped(StringBuilder
The buffer to write the help to buffer, String The text to be written to the buffer text)Builds the specified text to the specified buffer. |
| public void | buildWrapped(StringBuilder
The buffer to write the help to buffer, int The position on the next line for the first tab. nextLineTabStop, String The text to be written to the buffer text)Builds the specified text to the specified buffer. |
| public void | computeOptionsAndArguments(StringBuilder
The buffer to write the help to buffer, List<Option> The command line Options options, List<Argument> the command line Arguments arguments)Computes the help for the specified Options to the specified writer. |
| public void | |
| public void | |
| public static String | Returns: The String of paddingThe length of the String of padding to create. len)Return a String of padding of length |
| public static int | Returns: position on which the text must be wrapped or -1 if the wrap position is at the end of the textThe text being searched for the wrap position text, int width of the wrapped text width, int position from which to start the lookup whitespace
character startPos)Finds the next text wrap position after |
| public String | |
| public int | |
| public int | |
| public String | |
| public String | Returns: the separatorReturns the separator displayed between a long option and its value. |
| public String | |
| public Comparator | Returns: theComparator currently in use to sort the optionsComparator used to sort the options when they output in help text. |
| public String | |
| public String | |
| public int | |
| public static boolean | |
| protected StringBuilder | |
| protected StringBuilder | Returns: the StringBuilder with the rendered content.The StringBuilder to place the rendered Options and Arguments into. sb, List<Option> The command line Options options, List<Argument> The command line Arguments arguments)Renders the specified Options and Arguments and return the rendered output in a StringBuilder. |
| protected StringBuilder | Returns: the StringBuilder with the rendered Options contents.The StringBuilder to place the rendered text into. sb, int The number of characters to display per line width, int The position on the next line for the first tab. nextLineTabStop, String The text to be rendered. text)Render the specified text and return the rendered Options in a StringBuilder. |
| public Appendable | renderWrappedTextBlock(StringBuilder
The StringBuilder to place the rendered text into. sb, int The number of characters to display per line width, int The position on the next line for the first tab. nextLineTabStop, String The text to be rendered. text)Renders the specified text width a maximum width. |
| public static String | |
| public void | |
| public void | |
| public void | |
| public void | |
| public void | setLongOptionSeparator(String
the separator, typically ' ' or '='. longOptSeparator)Set the separator displayed between a long option and its value. |
| public void | |
| public void | setOptionComparator(Comparator<Option>
the comparator)Comparator to use for sorting the optionsSet the comparator used to sort the options when they output in help text. |
| public void | |
| public void | |
| public void | |
| public void | usage(StringBuilder
where the usage is going to be written builder, CLI the cli cli)Computes the usage of the given |
| public void | usage(StringBuilder
where the usage is going to be written builder, String a prefix to prepend to the usage line. It will be added between 'Usage: ' and the CLI name. prefix, CLI the cli cli)Computes the usage of the given |
| DEFAULT_ARG_NAME | back to summary |
|---|---|
| public static final String DEFAULT_ARG_NAME default name for an argument | |
| DEFAULT_DESC_PAD | back to summary |
|---|---|
| public static final int DEFAULT_DESC_PAD number of space characters to be prefixed to each description line | |
| DEFAULT_LEFT_PAD | back to summary |
|---|---|
| public static final int DEFAULT_LEFT_PAD default padding to the left of each line | |
| DEFAULT_LONG_OPT_PREFIX | back to summary |
|---|---|
| public static final String DEFAULT_LONG_OPT_PREFIX default prefix for long Option | |
| DEFAULT_LONG_OPT_SEPARATOR | back to summary |
|---|---|
| public static final String DEFAULT_LONG_OPT_SEPARATOR default separator displayed between a long Option and its value | |
| DEFAULT_OPT_PREFIX | back to summary |
|---|---|
| public static final String DEFAULT_OPT_PREFIX default prefix for shortOpts | |
| DEFAULT_USAGE_PREFIX | back to summary |
|---|---|
| public static final String DEFAULT_USAGE_PREFIX the string to display at the beginning of the usage statement | |
| DEFAULT_WIDTH | back to summary |
|---|---|
| public static final int DEFAULT_WIDTH default number of characters per line | |
| defaultArgName | back to summary |
|---|---|
| private String defaultArgName | |
| defaultLongOptPrefix | back to summary |
|---|---|
| private String defaultLongOptPrefix | |
| defaultOptionPrefix | back to summary |
|---|---|
| private String defaultOptionPrefix | |
| descPad | back to summary |
|---|---|
| private int descPad | |
| leftPad | back to summary |
|---|---|
| private int leftPad | |
| longOptSeparator | back to summary |
|---|---|
| private String longOptSeparator | |
| newLine | back to summary |
|---|---|
| private String newLine | |
| optionComparator | back to summary |
|---|---|
| protected Comparator<Option> optionComparator Comparator used to sort the options when they output in help text Defaults to case-insensitive alphabetical sorting by option key. | |
| usagePrefix | back to summary |
|---|---|
| private String usagePrefix | |
| width | back to summary |
|---|---|
| private int width | |
| UsageMessageFormatter | back to summary |
|---|---|
| public UsageMessageFormatter() | |
| appendArgument | back to summary |
|---|---|
| protected void appendArgument(StringBuilder buff, Argument argument, boolean required) Appends the usage clause for an Argument to a StringBuilder.
| |
| appendOption | back to summary |
|---|---|
| protected void appendOption(StringBuilder buff, Option option) Appends the usage clause for an Option to a StringBuilder.
| |
| buildWrapped | back to summary |
|---|---|
| public void buildWrapped(StringBuilder buffer, String text) Builds the specified text to the specified buffer.
| |
| buildWrapped | back to summary |
|---|---|
| public void buildWrapped(StringBuilder buffer, int nextLineTabStop, String text) Builds the specified text to the specified buffer.
| |
| computeOptionsAndArguments | back to summary |
|---|---|
| public void computeOptionsAndArguments(StringBuilder buffer, List<Option> options, List<Argument> arguments) Computes the help for the specified Options to the specified writer.
| |
| computeUsage | back to summary |
|---|---|
| public void computeUsage(StringBuilder buffer, String cmdLineSyntax) | |
| computeUsageLine | back to summary |
|---|---|
| public void computeUsageLine(StringBuilder buffer, String prefix, CLI cli) | |
| createPadding | back to summary |
|---|---|
| public static String createPadding(int len) Return a String of padding of length
| |
| findWrapPos | back to summary |
|---|---|
| public static int findWrapPos(String text, int width, int startPos) Finds the next text wrap position after
| |
| getArgName | back to summary |
|---|---|
| public String getArgName() | |
| getDescPadding | back to summary |
|---|---|
| public int getDescPadding() | |
| getLeftPadding | back to summary |
|---|---|
| public int getLeftPadding() | |
| getLongOptionPrefix | back to summary |
|---|---|
| public String getLongOptionPrefix() | |
| getLongOptionSeparator | back to summary |
|---|---|
| public String getLongOptionSeparator() Returns the separator displayed between a long option and its value.
| |
| getNewLine | back to summary |
|---|---|
| public String getNewLine() | |
| getOptionComparator | back to summary |
|---|---|
| public Comparator Comparator used to sort the options when they output in help text. Defaults to case-insensitive alphabetical sorting by option key.
| |
| getOptionPrefix | back to summary |
|---|---|
| public String getOptionPrefix() | |
| getUsagePrefix | back to summary |
|---|---|
| public String getUsagePrefix() | |
| getWidth | back to summary |
|---|---|
| public int getWidth() | |
| isNullOrEmpty | back to summary |
|---|---|
| public static boolean isNullOrEmpty(String s) | |
| renderCommands | back to summary |
|---|---|
| protected StringBuilder renderCommands(StringBuilder sb, Collection<CLI> commands) | |
| renderOptionsAndArguments | back to summary |
|---|---|
| protected StringBuilder renderOptionsAndArguments(StringBuilder sb, List<Option> options, List<Argument> arguments) Renders the specified Options and Arguments and return the rendered output in a StringBuilder.
| |
| renderWrappedText | back to summary |
|---|---|
| protected StringBuilder renderWrappedText(StringBuilder sb, int width, int nextLineTabStop, String text) Render the specified text and return the rendered Options in a StringBuilder.
| |
| renderWrappedTextBlock | back to summary |
|---|---|
| public Appendable renderWrappedTextBlock(StringBuilder sb, int width, int nextLineTabStop, String text) Renders the specified text width a maximum width. This method differs from renderWrappedText by not removing leading spaces after a new line.
| |
| rtrim | back to summary |
|---|---|
| public static String rtrim(String s) Remove the trailing whitespace from the specified String. | |
| setArgName | back to summary |
|---|---|
| public void setArgName(String name) | |
| setDescPadding | back to summary |
|---|---|
| public void setDescPadding(int padding) | |
| setLeftPadding | back to summary |
|---|---|
| public void setLeftPadding(int padding) | |
| setLongOptionPrefix | back to summary |
|---|---|
| public void setLongOptionPrefix(String prefix) | |
| setLongOptionSeparator | back to summary |
|---|---|
| public void setLongOptionSeparator(String longOptSeparator) Set the separator displayed between a long option and its value. Ensure that the separator specified is supported by the parser used, typically ' ' or '='.
| |
| setNewLine | back to summary |
|---|---|
| public void setNewLine(String newline) | |
| setOptionComparator | back to summary |
|---|---|
| public void setOptionComparator(Comparator<Option> comparator) Set the comparator used to sort the options when they output in help text. Passing in a null comparator will keep the options in the order they were declared.
| |
| setOptionPrefix | back to summary |
|---|---|
| public void setOptionPrefix(String prefix) | |
| setUsagePrefix | back to summary |
|---|---|
| public void setUsagePrefix(String prefix) | |
| setWidth | back to summary |
|---|---|
| public void setWidth(int width) | |
| usage | back to summary |
|---|---|
| public void usage(StringBuilder builder, CLI cli) Computes the usage of the given
| |
| usage | back to summary |
|---|---|
| public void usage(StringBuilder builder, String prefix, CLI cli) Computes the usage of the given
| |