Package io.vertx.mutiny.core.cli
Class CLI
- java.lang.Object
-
- io.vertx.mutiny.core.cli.CLI
-
public class CLI extends Object
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=baror-flag. The supported formats depend on the used parser. Arguments are unlike options raw values. Options are defined usingOption, while argument are defined usingArgument. Command line interfaces also define a summary and a description. These attributes are used in the usage generation . To disable the help generation, set thehiddenattribute totrue. Command Line Interface object does not contains "value", it's a model. It must be evaluated by a parser that returns aCommandLineobject containing the argument and option values. NOTE: This class has been automatically generated from theoriginalnon Mutiny-ified interface using Vert.x codegen.
-
-
Field Summary
Fields Modifier and Type Field Description static TypeArg<CLI>__TYPE_ARG
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description CLIaddArgument(io.vertx.core.cli.Argument arg)CLIaddArguments(List<io.vertx.core.cli.Argument> args)CLIaddOption(io.vertx.core.cli.Option option)CLIaddOptions(List<io.vertx.core.cli.Option> options)static CLIcreate(String name)booleanequals(Object o)io.vertx.core.cli.ArgumentgetArgument(int index)io.vertx.core.cli.ArgumentgetArgument(String name)List<io.vertx.core.cli.Argument>getArguments()io.vertx.core.cli.CLIgetDelegate()StringgetDescription()StringgetName()io.vertx.core.cli.OptiongetOption(String name)List<io.vertx.core.cli.Option>getOptions()intgetPriority()StringgetSummary()inthashCode()booleanisHidden()static CLInewInstance(io.vertx.core.cli.CLI arg)CommandLineparse(List<String> arguments)CommandLineparse(List<String> arguments, boolean validate)CLIremoveArgument(int index)CLIremoveOption(String name)CLIsetArguments(List<io.vertx.core.cli.Argument> args)CLIsetDescription(String desc)CLIsetHidden(boolean hidden)CLIsetName(String name)CLIsetOptions(List<io.vertx.core.cli.Option> options)CLIsetPriority(int priority)CLIsetSummary(String summary)StringtoString()
-
-
-
Constructor Detail
-
CLI
public CLI(io.vertx.core.cli.CLI delegate)
-
CLI
public CLI(Object delegate)
-
-
Method Detail
-
getDelegate
public io.vertx.core.cli.CLI getDelegate()
-
create
public static CLI create(String name)
- Parameters:
name- the name of the CLI (must not benull)- Returns:
- the created instance of
CLI
-
parse
public CommandLine parse(List<String> arguments)
- Parameters:
arguments- the arguments- Returns:
- the creates command line
-
parse
public CommandLine parse(List<String> arguments, boolean validate)
- Parameters:
arguments- the argumentsvalidate- enable / disable parsing validation- Returns:
- the creates command line
-
getName
public String getName()
- Returns:
- the CLI name.
-
setName
public CLI setName(String name)
- Parameters:
name- the name- Returns:
- the current
CLIinstance
-
getDescription
public String getDescription()
- Returns:
- the CLI description.
-
getSummary
public String getSummary()
- Returns:
- the CLI summary.
-
setSummary
public CLI setSummary(String summary)
- Parameters:
summary- the summary- Returns:
- the current
CLIinstance
-
isHidden
public boolean isHidden()
- Returns:
trueif the currentCLIis hidden, otherwise
-
setHidden
public CLI setHidden(boolean hidden)
- Parameters:
hidden- enables or disables the hidden aspect of the CI- Returns:
- the current
CLIinstance
-
getOptions
public List<io.vertx.core.cli.Option> getOptions()
- Returns:
- the list of options, empty if none.
-
addOption
public CLI addOption(io.vertx.core.cli.Option option)
- Parameters:
option- the option, must not benull.- Returns:
- the current
CLIinstance
-
addOptions
public CLI addOptions(List<io.vertx.core.cli.Option> options)
- Parameters:
options- the options, must not benull- Returns:
- the current
CLIinstance
-
setOptions
public CLI setOptions(List<io.vertx.core.cli.Option> options)
- Parameters:
options- the list of options, must not benull- Returns:
- the current
CLIinstance
-
getArguments
public List<io.vertx.core.cli.Argument> getArguments()
- Returns:
- the list of argument, empty if none.
-
addArgument
public CLI addArgument(io.vertx.core.cli.Argument arg)
- Parameters:
arg- the argument, must not benull- Returns:
- the current
CLIinstance
-
addArguments
public CLI addArguments(List<io.vertx.core.cli.Argument> args)
- Parameters:
args- the arguments, must not benull- Returns:
- the current
CLIinstance
-
setArguments
public CLI setArguments(List<io.vertx.core.cli.Argument> args)
- Parameters:
args- the list of arguments, must not benull- Returns:
- the current
CLIinstance
-
getOption
public io.vertx.core.cli.Option getOption(String name)
- Parameters:
name- the name, must not benull- Returns:
- the
Option,nullif not found
-
getArgument
public io.vertx.core.cli.Argument getArgument(String name)
- 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
public CLI removeOption(String name)
- Parameters:
name- the option name- Returns:
- the current
CLIinstance
-
removeArgument
public CLI removeArgument(int index)
- Parameters:
index- the argument index- Returns:
- the current
CLIinstance
-
getPriority
public int getPriority()
- Returns:
- the CLI priority.
-
setPriority
public CLI setPriority(int priority)
- Parameters:
priority- the priority- Returns:
- the current
CLIinstance
-
newInstance
public static CLI newInstance(io.vertx.core.cli.CLI arg)
-
-