Package picocli
Class CommandLine.Help.DefaultOptionRenderer
java.lang.Object
picocli.CommandLine.Help.DefaultOptionRenderer
- All Implemented Interfaces:
CommandLine.Help.IOptionRenderer
- Enclosing class:
CommandLine.Help
static class CommandLine.Help.DefaultOptionRenderer
extends Object
implements CommandLine.Help.IOptionRenderer
The DefaultOptionRenderer converts
Options
to five columns of text to match the default
TextTable column layout. The first row of values looks like this:
- the required option marker (if the option is required)
- 2-character short option name (or empty string if no short option exists)
- comma separator (only if both short option and long option exist, empty string otherwise)
- comma-separated string with long option name(s)
- first element of the
CommandLine.Model.ArgSpec.description()
array
Following this, there will be one row for each of the remaining elements of the CommandLine.Model.ArgSpec.description()
array, and these rows look like {"", "", "", option.description()[i]}
.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate CommandLine.Help.Ansi.Text
createLongOptionText
(CommandLine.Model.OptionSpec option, CommandLine.Help.IParamLabelRenderer renderer, CommandLine.Help.ColorScheme scheme, String longOption) render
(CommandLine.Model.OptionSpec option, CommandLine.Help.IParamLabelRenderer paramLabelRenderer, CommandLine.Help.ColorScheme scheme) Returns a text representation of the specified option and its parameter(s) if any.private CommandLine.Help.Ansi.Text[][]
renderDescriptionLines
(CommandLine.Model.OptionSpec option, CommandLine.Help.ColorScheme scheme, String requiredOption, String shortOption, CommandLine.Help.Ansi.Text longOptionText)
-
Field Details
-
requiredMarker
-
showDefaultValues
private final boolean showDefaultValues -
sep
-
-
Constructor Details
-
DefaultOptionRenderer
-
-
Method Details
-
render
public CommandLine.Help.Ansi.Text[][] render(CommandLine.Model.OptionSpec option, CommandLine.Help.IParamLabelRenderer paramLabelRenderer, CommandLine.Help.ColorScheme scheme) Description copied from interface:CommandLine.Help.IOptionRenderer
Returns a text representation of the specified option and its parameter(s) if any.- Specified by:
render
in interfaceCommandLine.Help.IOptionRenderer
- Parameters:
option
- the command line option to show online usage help forparamLabelRenderer
- responsible for rendering option parameters to textscheme
- color scheme for applying ansi color styles to options and option parameters- Returns:
- a 2-dimensional array of text values: one or more rows, each containing one or more columns
-
createLongOptionText
private CommandLine.Help.Ansi.Text createLongOptionText(CommandLine.Model.OptionSpec option, CommandLine.Help.IParamLabelRenderer renderer, CommandLine.Help.ColorScheme scheme, String longOption) -
renderDescriptionLines
private CommandLine.Help.Ansi.Text[][] renderDescriptionLines(CommandLine.Model.OptionSpec option, CommandLine.Help.ColorScheme scheme, String requiredOption, String shortOption, CommandLine.Help.Ansi.Text longOptionText)
-