Package io.vertx.mutiny.core.cli
Class CLI
java.lang.Object
io.vertx.mutiny.core.cli.CLI
- All Implemented Interfaces:
MutinyDelegate
Interface defining a command-line interface (in other words a command such as 'run', 'ls'...).
This interface is polyglot to ease reuse such as in Vert.x Shell.
A command line interface has a name, and defines a set of options and arguments. Options are key-value pair such
as
-foo=bar or -flag. The supported formats depend on the used parser. Arguments are unlike
options raw values. Options are defined using
Option, while argument are defined using Argument.
Command line interfaces also define a summary and a description. These attributes are used in the usage generation
. To disable the help generation, set the hidden attribute to true.
Command Line Interface object does not contains "value", it's a model. It must be evaluated by a
parser that returns a CommandLine object containing the argument and option values.
NOTE: This class has been automatically generated from the original non Mutiny-ified interface using Vert.x codegen.-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddArgument(io.vertx.core.cli.Argument arg) addArguments(List<io.vertx.core.cli.Argument> args) addOption(io.vertx.core.cli.Option option) addOptions(List<io.vertx.core.cli.Option> options) static CLIbooleanio.vertx.core.cli.ArgumentgetArgument(int index) io.vertx.core.cli.ArgumentgetArgument(String name) List<io.vertx.core.cli.Argument>io.vertx.core.cli.CLIgetName()io.vertx.core.cli.OptionList<io.vertx.core.cli.Option>intinthashCode()booleanisHidden()static CLInewInstance(io.vertx.core.cli.CLI arg) removeArgument(int index) removeOption(String name) setArguments(List<io.vertx.core.cli.Argument> args) setDescription(String desc) setHidden(boolean hidden) setOptions(List<io.vertx.core.cli.Option> options) setPriority(int priority) setSummary(String summary) toString()
-
Field Details
-
__TYPE_ARG
-
-
Constructor Details
-
CLI
public CLI(io.vertx.core.cli.CLI delegate) -
CLI
-
-
Method Details
-
getDelegate
public io.vertx.core.cli.CLI getDelegate()- Specified by:
getDelegatein interfaceMutinyDelegate- Returns:
- the delegate used by this Mutiny object of generated type
-
toString
-
equals
-
hashCode
public int hashCode() -
create
- Parameters:
name- the name of the CLI (must not benull)- Returns:
- the created instance of
CLI
-
parse
- Parameters:
arguments- the arguments- Returns:
- the creates command line
-
parse
- Parameters:
arguments- the argumentsvalidate- enable / disable parsing validation- Returns:
- the creates command line
-
getName
- Returns:
- the CLI name.
-
setName
- Parameters:
name- the name- Returns:
- the current
CLIinstance
-
getDescription
- Returns:
- the CLI description.
-
setDescription
-
getSummary
- Returns:
- the CLI summary.
-
setSummary
- Parameters:
summary- the summary- Returns:
- the current
CLIinstance
-
isHidden
public boolean isHidden()- Returns:
trueif the currentCLIis hidden, otherwise
-
setHidden
- Parameters:
hidden- enables or disables the hidden aspect of the CI- Returns:
- the current
CLIinstance
-
getOptions
- Returns:
- the list of options, empty if none.
-
addOption
- Parameters:
option- the option, must not benull.- Returns:
- the current
CLIinstance
-
addOptions
- Parameters:
options- the options, must not benull- Returns:
- the current
CLIinstance
-
setOptions
- Parameters:
options- the list of options, must not benull- Returns:
- the current
CLIinstance
-
getArguments
- Returns:
- the list of argument, empty if none.
-
addArgument
- Parameters:
arg- the argument, must not benull- Returns:
- the current
CLIinstance
-
addArguments
- Parameters:
args- the arguments, must not benull- Returns:
- the current
CLIinstance
-
setArguments
- Parameters:
args- the list of arguments, must not benull- Returns:
- the current
CLIinstance
-
getOption
- Parameters:
name- the name, must not benull- Returns:
- the
Option,nullif not found
-
getArgument
- Parameters:
name- the name of the argument, must not benull- Returns:
- the
Argument,nullif not found.
-
getArgument
public io.vertx.core.cli.Argument getArgument(int index) - Parameters:
index- the index, must be positive or zero.- Returns:
- the
Argument,nullif not found.
-
removeOption
- Parameters:
name- the option name- Returns:
- the current
CLIinstance
-
removeArgument
- Parameters:
index- the argument index- Returns:
- the current
CLIinstance
-
getPriority
public int getPriority()- Returns:
- the CLI priority.
-
setPriority
- Parameters:
priority- the priority- Returns:
- the current
CLIinstance
-
newInstance
-