Package org.jline.shell
Class CommandDescription.Builder
java.lang.Object
org.jline.shell.CommandDescription.Builder
-
Method Summary
Modifier and TypeMethodDescriptionargument(ArgumentDescription argument) Adds an argument description.arguments(List<ArgumentDescription> arguments) Sets all argument descriptions.build()Builds the command description.command(boolean command) Sets whether this description represents a command.errorIndex(int errorIndex) Sets the error index.errorPattern(Pattern errorPattern) Sets the error pattern.highlighted(boolean highlighted) Sets whether the command should be highlighted.mainDescription(List<AttributedString> mainDescription) Sets the main description.option(String key, List<AttributedString> description) Adds an option with its description.options(Map<String, List<AttributedString>> options) Sets all options.subcommand(boolean subcommand) Sets whether this description represents a subcommand.valid(boolean valid) Sets whether this description is valid.
-
Method Details
-
mainDescription
Sets the main description.- Parameters:
mainDescription- the description lines- Returns:
- this builder
-
argument
Adds an argument description.- Parameters:
argument- the argument description- Returns:
- this builder
-
arguments
Sets all argument descriptions.- Parameters:
arguments- the argument descriptions- Returns:
- this builder
-
option
Adds an option with its description.- Parameters:
key- the option syntax (e.g., "-l --long")description- the option description- Returns:
- this builder
-
options
Sets all options.- Parameters:
options- the options map- Returns:
- this builder
-
valid
Sets whether this description is valid.- Parameters:
valid- true if valid- Returns:
- this builder
-
command
Sets whether this description represents a command.- Parameters:
command- true if this is a command description- Returns:
- this builder
-
subcommand
Sets whether this description represents a subcommand.- Parameters:
subcommand- true if this is a subcommand- Returns:
- this builder
-
highlighted
Sets whether the command should be highlighted.- Parameters:
highlighted- true if highlighted- Returns:
- this builder
-
errorPattern
Sets the error pattern.- Parameters:
errorPattern- the error pattern- Returns:
- this builder
-
errorIndex
Sets the error index.- Parameters:
errorIndex- the error index- Returns:
- this builder
-
build
Builds the command description.- Returns:
- the immutable command description
-