open class UsageMessageFormatter
Usage message formatter.
Author
Clement Escoffier
UsageMessageFormatter()
Usage message formatter. |
static val DEFAULT_ARG_NAME: String
default name for an argument |
|
static val DEFAULT_DESC_PAD: Int
number of space characters to be prefixed to each description line |
|
static val DEFAULT_LEFT_PAD: Int
default padding to the left of each line |
|
static val DEFAULT_LONG_OPT_PREFIX: String
default prefix for long Option |
|
static val DEFAULT_LONG_OPT_SEPARATOR: String
default separator displayed between a long Option and its value |
|
static val DEFAULT_OPT_PREFIX: String
default prefix for shortOpts |
|
static val DEFAULT_USAGE_PREFIX: String
the string to display at the beginning of the usage statement |
|
static val DEFAULT_WIDTH: Int
default number of characters per line |
open fun buildWrapped(buffer: StringBuilder, text: String): Unitopen fun buildWrapped(buffer: StringBuilder, nextLineTabStop: Int, text: String): Unit
Builds the specified text to the specified buffer. |
|
open fun computeOptionsAndArguments(buffer: StringBuilder, options: MutableList<Option>, arguments: MutableList<Argument>): Unit
Computes the help for the specified Options to the specified writer. |
|
open fun computeUsage(buffer: StringBuilder, cmdLineSyntax: String): Unit |
|
open fun computeUsageLine(buffer: StringBuilder, prefix: String, cli: CLI): Unit |
|
open static fun createPadding(len: Int): String
Return a String of padding of length |
|
open static fun findWrapPos(text: String, width: Int, startPos: Int): Int
Finds the next text wrap position after |
|
open fun getArgName(): String |
|
open fun getDescPadding(): Int |
|
open fun getLeftPadding(): Int |
|
open fun getLongOptionPrefix(): String |
|
open fun getLongOptionSeparator(): String
Returns the separator displayed between a long option and its value. |
|
open fun getNewLine(): String |
|
open fun getOptionComparator(): Comparator<Option>
Comparator used to sort the options when they output in help text. Defaults to case-insensitive alphabetical sorting by option key. |
|
open fun getOptionPrefix(): String |
|
open fun getUsagePrefix(): String |
|
open fun getWidth(): Int |
|
open static fun isNullOrEmpty(s: String): Boolean |
|
open fun renderWrappedTextBlock(sb: StringBuilder, width: Int, nextLineTabStop: Int, text: String): Appendable
Renders the specified text width a maximum width. This method differs from renderWrappedText by not removing leading spaces after a new line. |
|
open static fun rtrim(s: String): String
Remove the trailing whitespace from the specified String. |
|
open fun setArgName(name: String): Unit |
|
open fun setDescPadding(padding: Int): Unit |
|
open fun setLeftPadding(padding: Int): Unit |
|
open fun setLongOptionPrefix(prefix: String): Unit |
|
open fun setLongOptionSeparator(longOptSeparator: String): Unit
Set the separator displayed between a long option and its value. Ensure that the separator specified is supported by the parser used, typically ' ' or '='. |
|
open fun setNewLine(newline: String): Unit |
|
open fun setOptionComparator(comparator: Comparator<Option>): Unit
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. |
|
open fun setOptionPrefix(prefix: String): Unit |
|
open fun setUsagePrefix(prefix: String): Unit |
|
open fun setWidth(width: Int): Unit |
|
open fun usage(builder: StringBuilder, cli: CLI): Unitopen fun usage(builder: StringBuilder, prefix: String, cli: CLI): Unit
Computes the usage of the given CLI. |