Class CommandLine.Help.DefaultOptionRenderer
java.lang.Object
org.apache.logging.log4j.core.tools.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.Option.description()
array
Following this, there will be one row for each of the remaining elements of the CommandLine.Option.description()
array, and these rows look like {"", "", "", option.description()[i]}
.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate Object
createDefaultValue
(Field field) private CommandLine.Help.Ansi.Text
createLongOptionText
(Field field, CommandLine.Help.IParamLabelRenderer renderer, CommandLine.Help.ColorScheme scheme, String longOption) render
(CommandLine.Option option, Field field, CommandLine.Help.IParamLabelRenderer paramLabelRenderer, CommandLine.Help.ColorScheme scheme) Returns a text representation of the specified Option and the Field that captures the option value.private CommandLine.Help.Ansi.Text[][]
renderDescriptionLines
(CommandLine.Option option, CommandLine.Help.ColorScheme scheme, String requiredOption, String shortOption, CommandLine.Help.Ansi.Text longOptionText, Object defaultValue)
-
Field Details
-
requiredMarker
-
command
-
sep
-
showDefault
private boolean showDefault
-
-
Constructor Details
-
DefaultOptionRenderer
DefaultOptionRenderer()
-
-
Method Details
-
render
public CommandLine.Help.Ansi.Text[][] render(CommandLine.Option option, Field field, CommandLine.Help.IParamLabelRenderer paramLabelRenderer, CommandLine.Help.ColorScheme scheme) Description copied from interface:CommandLine.Help.IOptionRenderer
Returns a text representation of the specified Option and the Field that captures the option value.- Specified by:
render
in interfaceCommandLine.Help.IOptionRenderer
- Parameters:
option
- the command line option to show online usage help forfield
- the field that will hold the value for the command line optionparamLabelRenderer
- 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
-
createDefaultValue
-
createLongOptionText
private CommandLine.Help.Ansi.Text createLongOptionText(Field field, CommandLine.Help.IParamLabelRenderer renderer, CommandLine.Help.ColorScheme scheme, String longOption) -
renderDescriptionLines
private CommandLine.Help.Ansi.Text[][] renderDescriptionLines(CommandLine.Option option, CommandLine.Help.ColorScheme scheme, String requiredOption, String shortOption, CommandLine.Help.Ansi.Text longOptionText, Object defaultValue)
-