Package picocli
Class CommandLine.Help.DefaultParamLabelRenderer
java.lang.Object
picocli.CommandLine.Help.DefaultParamLabelRenderer
- All Implemented Interfaces:
CommandLine.Help.IParamLabelRenderer
- Enclosing class:
CommandLine.Help
static class CommandLine.Help.DefaultParamLabelRenderer
extends Object
implements CommandLine.Help.IParamLabelRenderer
DefaultParamLabelRenderer separates option parameters from their option names with a
separator string, and, unless
CommandLine.Model.ArgSpec.hideParamSyntax()
is true, surrounds optional values with '['
and ']'
characters
and uses ellipses ("...") to indicate that any number of values is allowed for options or parameters with variable arity.-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionDefaultParamLabelRenderer
(CommandLine.Model.CommandSpec commandSpec) Constructs a new DefaultParamLabelRenderer with the specified separator string. -
Method Summary
Modifier and TypeMethodDescriptionrenderParameterLabel
(CommandLine.Model.ArgSpec argSpec, CommandLine.Help.Ansi ansi, List<CommandLine.Help.Ansi.IStyle> styles) Returns a text rendering of the option parameter or positional parameter; returns an empty string""
if the option is a boolean and does not take a parameter.Returns the separator between option name and param label.
-
Field Details
-
commandSpec
-
-
Constructor Details
-
DefaultParamLabelRenderer
Constructs a new DefaultParamLabelRenderer with the specified separator string.
-
-
Method Details
-
separator
Description copied from interface:CommandLine.Help.IParamLabelRenderer
Returns the separator between option name and param label.- Specified by:
separator
in interfaceCommandLine.Help.IParamLabelRenderer
- Returns:
- the separator between option name and param label
-
renderParameterLabel
public CommandLine.Help.Ansi.Text renderParameterLabel(CommandLine.Model.ArgSpec argSpec, CommandLine.Help.Ansi ansi, List<CommandLine.Help.Ansi.IStyle> styles) Description copied from interface:CommandLine.Help.IParamLabelRenderer
Returns a text rendering of the option parameter or positional parameter; returns an empty string""
if the option is a boolean and does not take a parameter.- Specified by:
renderParameterLabel
in interfaceCommandLine.Help.IParamLabelRenderer
- Parameters:
argSpec
- the named or positional parameter with a parameter labelansi
- determines whether ANSI escape codes should be emitted or notstyles
- the styles to apply to the parameter label- Returns:
- a text rendering of the Option parameter or positional parameter
-