class CLI extends AnyRef
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 io.vertx.scala.core.cli.CommandLine object containing the argument and option values.
- Alphabetic
- By Inheritance
- CLI
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Instance Constructors
- new CLI(_asJava: AnyRef)
Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
addArgument(arg: Argument): CLI
Adds an argument.
Adds an argument. * @param arg the argument, must not be
null
see Argument- returns
the current CLI instance
-
def
addArguments(args: Buffer[Argument]): CLI
Adds a set of arguments.
Adds a set of arguments. Unlike io.vertx.scala.core.cli.CLI#setArguments, this method does not remove the existing arguments. The given list is appended to the existing list. * @param args the arguments, must not be
null
- returns
the current CLI instance
-
def
addOption(option: Option): CLI
Adds an option.
Adds an option. * @param option the option, must not be
null
. see Option- returns
the current CLI instance
-
def
addOptions(options: Buffer[Option]): CLI
Adds a set of options.
Adds a set of options. Unlike io.vertx.scala.core.cli.CLI#setOptions
, this method does not remove the existing options. The given list is appended to the existing list. * @param options the options, must not be
null- returns
the current CLI instance
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
- def asJava: AnyRef
-
def
clone(): AnyRef
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @native() @throws( ... )
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
finalize(): Unit
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
def
getArgument(index: Int): scala.Option[Argument]
Gets an Argument based on its index.
-
def
getArgument(name: String): scala.Option[Argument]
Gets an Argument based on its name (argument name).
-
def
getArguments(): Buffer[Argument]
Gets the list of defined arguments.
Gets the list of defined arguments. * @return the list of argument, empty if none.
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
def
getDescription(): scala.Option[String]
- returns
the CLI description.
-
def
getName(): String
- returns
the CLI name.
-
def
getOption(name: String): scala.Option[Option]
Gets an Option based on its name (short name, long name or argument name).
-
def
getOptions(): Buffer[Option]
Gets the list of options.
Gets the list of options. * @return the list of options, empty if none.
-
def
getSummary(): scala.Option[String]
- returns
the CLI summary.
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
def
isHidden(): Boolean
Checks whether or not the current io.vertx.scala.core.cli.CLI instance is hidden.
Checks whether or not the current io.vertx.scala.core.cli.CLI instance is hidden. * @return
true
if the current CLI is hidden, false otherwise -
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
def
parse(arguments: Buffer[String], validate: Boolean): CommandLine
Parses the user command line interface and create a new io.vertx.scala.core.cli.CommandLine containing extracting values.
Parses the user command line interface and create a new io.vertx.scala.core.cli.CommandLine containing extracting values. * @param arguments the arguments
- validate
enable / disable parsing validation
- returns
the creates command line
-
def
parse(arguments: Buffer[String]): CommandLine
Parses the user command line interface and create a new io.vertx.scala.core.cli.CommandLine containing extracting values.
Parses the user command line interface and create a new io.vertx.scala.core.cli.CommandLine containing extracting values. * @param arguments the arguments
- returns
the creates command line
-
def
removeArgument(index: Int): CLI
Removes an argument identified by its index.
Removes an argument identified by its index. This method does nothing if the argument cannot be found. * @param index the argument index
- returns
the current CLI instance
-
def
removeOption(name: String): CLI
Removes an option identified by its name.
Removes an option identified by its name. This method does nothing if the option cannot be found. * @param name the option name
- returns
the current CLI instance
-
def
setArguments(args: Buffer[Argument]): CLI
Sets the list of arguments.
Sets the list of arguments. * @param args the list of arguments, must not be
null
- returns
the current CLI instance
- def setDescription(desc: String): CLI
-
def
setHidden(hidden: Boolean): CLI
Sets whether or not the current instance of io.vertx.scala.core.cli.CLI must be hidden.
Sets whether or not the current instance of io.vertx.scala.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. * @param hidden enables or disables the hidden aspect of the CI
- returns
the current CLI instance
-
def
setName(name: String): CLI
Sets the name of the CLI.
Sets the name of the CLI. * @param name the name
- returns
the current CLI instance
-
def
setOptions(options: Buffer[Option]): CLI
Sets the list of arguments.
Sets the list of arguments. * @param options the list of options, must not be
null
- returns
the current CLI instance
-
def
setSummary(summary: String): CLI
Sets the summary of the CLI.
Sets the summary of the CLI. * @param summary the summary
- returns
the current CLI instance
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toString(): String
- Definition Classes
- AnyRef → Any
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @throws( ... )