Interface CommandRegistration.Builder
- All Known Implementing Classes:
- CommandRegistration.BaseBuilder,- CommandRegistration.DefaultBuilder
- Enclosing interface:
- CommandRegistration
public static interface CommandRegistration.Builder
Builder interface for 
CommandRegistration.- 
Method SummaryModifier and TypeMethodDescriptionavailability(Supplier<Availability> availability) Define anAvailabilitysuppliear for a command.build()Builds aCommandRegistration.Define commands this registration uses.defaultOptionNameModifier(Function<String, String> modifier) Provides a global option name modifier.description(String description) Define a description text for a command.Define a group for a command.hidden()Define a command to be hidden.hidden(boolean hidden) Define a command to be hidden by a given flag.DefineInteractionModefor a command.Define an alias what this command should executeDefine an error handling what this command should useDefine an exit code what this command should executeDefine help options what this command should use.Define an option what this command should user for.Define a target what this command should execute
- 
Method Details- 
commandDefine commands this registration uses. Essentially defines a full set of main and sub commands. It doesn't matter if full command is defined in one string or multiple strings as "words" are splitted and trimmed with whitespaces. You will get result ofcommand subcommand1 subcommand2, ....- Parameters:
- commands- the commands
- Returns:
- builder for chaining
 
- 
interactionModeDefineInteractionModefor a command.- Parameters:
- mode- the interaction mode
- Returns:
- builder for chaining
 
- 
descriptionDefine a description text for a command.- Parameters:
- description- the description text
- Returns:
- builder for chaining
 
- 
availabilityDefine anAvailabilitysuppliear for a command.- Parameters:
- availability- the availability
- Returns:
- builder for chaining
 
- 
groupDefine a group for a command.- Parameters:
- group- the group
- Returns:
- builder for chaining
 
- 
defaultOptionNameModifierProvides a global option name modifier. Will be used with all options to modify long names. Usual use case is to enforce naming convention i.e. to havesnake-casefor all names.- Parameters:
- modifier- to modifier to change option name
- Returns:
- builder for chaining
 
- 
withOptionCommandRegistration.OptionSpec withOption()Define an option what this command should user for. Can be used multiple times.- Returns:
- option spec for chaining
 
- 
withTargetCommandRegistration.TargetSpec withTarget()Define a target what this command should execute- Returns:
- target spec for chaining
 
- 
withAliasCommandRegistration.AliasSpec withAlias()Define an alias what this command should execute- Returns:
- alias spec for chaining
 
- 
withExitCodeCommandRegistration.ExitCodeSpec withExitCode()Define an exit code what this command should execute- Returns:
- exit code spec for chaining
 
- 
withErrorHandlingCommandRegistration.ErrorHandlingSpec withErrorHandling()Define an error handling what this command should use- Returns:
- error handling spec for chaining
 
- 
withHelpOptionsCommandRegistration.HelpOptionsSpec withHelpOptions()Define help options what this command should use.- Returns:
- help options spec for chaining
 
- 
buildCommandRegistration build()Builds aCommandRegistration.- Returns:
- a command registration
 
 
-