vertx / io.vertx.reactivex.core.cli / CLI

CLI

open class CLI

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 io.vertx.core.cli.Option, while argument are defined using io.vertx.core.cli.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 io.vertx.reactivex.core.cli.CommandLine object containing the argument and option values. NOTE: This class has been automatically generated from the io.vertx.core.cli.CLI non RX-ified interface using Vert.x codegen.

Constructors

<init>

CLI(delegate: CLI)

Properties

__TYPE_ARG

static val __TYPE_ARG: TypeArg<CLI>

Functions

addArgument

open fun addArgument(arg: Argument): CLI

Adds an argument.

addArguments

open fun addArguments(args: MutableList<Argument>): CLI

Adds a set of arguments. Unlike io.vertx.reactivex.core.cli.CLI#setArguments, this method does not remove the existing arguments. The given list is appended to the existing list.

addOption

open fun addOption(option: Option): CLI

Adds an option.

addOptions

open fun addOptions(options: MutableList<Option>): CLI

Adds a set of options. Unlike io.vertx.reactivex.core.cli.CLI#setOptions}, this method does not remove the existing options. The given list is appended to the existing list.

create

open static fun create(name: String): CLI

Creates an instance of io.vertx.reactivex.core.cli.CLI using the default implementation.

equals

open fun equals(other: Any?): Boolean

getArgument

open fun getArgument(name: String): Argument

Gets an io.vertx.core.cli.Argument based on its name (argument name).

open fun getArgument(index: Int): Argument

Gets an io.vertx.core.cli.Argument based on its index.

getArguments

open fun getArguments(): MutableList<Argument>

Gets the list of defined arguments.

getDelegate

open fun getDelegate(): CLI

getDescription

open fun getDescription(): String

getName

open fun getName(): String

getOption

open fun getOption(name: String): Option

Gets an io.vertx.core.cli.Option based on its name (short name, long name or argument name).

getOptions

open fun getOptions(): MutableList<Option>

Gets the list of options.

getSummary

open fun getSummary(): String

hashCode

open fun hashCode(): Int

isHidden

open fun isHidden(): Boolean

Checks whether or not the current io.vertx.reactivex.core.cli.CLI instance is hidden.

newInstance

open static fun newInstance(arg: CLI): CLI

parse

open fun parse(arguments: MutableList<String>): CommandLine
open fun parse(arguments: MutableList<String>, validate: Boolean): CommandLine

Parses the user command line interface and create a new io.vertx.reactivex.core.cli.CommandLine containing extracting values.

removeArgument

open fun removeArgument(index: Int): CLI

Removes an argument identified by its index. This method does nothing if the argument cannot be found.

removeOption

open fun removeOption(name: String): CLI

Removes an option identified by its name. This method does nothing if the option cannot be found.

setArguments

open fun setArguments(args: MutableList<Argument>): CLI

Sets the list of arguments.

setDescription

open fun setDescription(desc: String): CLI

setHidden

open fun setHidden(hidden: Boolean): CLI

Sets whether or not the current instance of io.vertx.reactivex.core.cli.CLI must be hidden. Hidden CLI are not listed when displaying usages / help messages. In other words, hidden commands are for power user.

setName

open fun setName(name: String): CLI

Sets the name of the CLI.

setOptions

open fun setOptions(options: MutableList<Option>): CLI

Sets the list of arguments.

setSummary

open fun setSummary(summary: String): CLI

Sets the summary of the CLI.

toString

open fun toString(): String