vertx-lang-scala-docs_2.12 3.5.3.CR1 API < Back
 

# Packages

-  package root
  Definition Classes
    root
-  package io
  Definition Classes
    root
-  package vertx
  Definition Classes
    io
-  package scala
  Definition Classes
    vertx
-  package core
  Definition Classes
    scala
-  package cli
  Definition Classes
    core
- Argument
- CLI
- CommandLine
- Option

c

io.vertx.scala.core.cli

# CLI 

###
Companion object CLI

#### 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.

Linear Supertypes
AnyRef, Any
 
Ordering

1. Alphabetic
2. By Inheritance

Inherited

1. CLI
2. AnyRef
3. Any

1. Hide All
2. Show All

Visibility

1. Public
2. All

### Instance Constructors

1.  new CLI(_asJava: AnyRef)

### Value Members

1.  final def !=(arg0: Any): Boolean
   Definition Classes
     AnyRef → Any
2.  final def ##(): Int
   Definition Classes
     AnyRef → Any
3.  final def ==(arg0: Any): Boolean
   Definition Classes
     AnyRef → Any
4.  def addArgument(arg: Argument): CLI

   Adds an argument.

   Adds an argument.

   arg

     the argument, must not be `null`see Argument

   returns

     the current CLI instance

5.  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.

   args

     the arguments, must not be `null`

   returns

     the current CLI instance

6.  def addOption(option: Option): CLI

   Adds an option.

   Adds an option.

   option

     the option, must not be `null`.see Option

   returns

     the current CLI instance

7.  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.`

   options

     the options, must not be `null`

   returns

     the current CLI instance

8.  final def asInstanceOf[T0]: T0
   Definition Classes
     Any
9.  def asJava: AnyRef
10.  def clone(): AnyRef
    Attributes
      protected[java.lang]
    Definition Classes
      AnyRef
    Annotations
      @native() @throws( ... )
11.  final def eq(arg0: AnyRef): Boolean
    Definition Classes
      AnyRef
12.  def equals(arg0: Any): Boolean
    Definition Classes
      AnyRef → Any
13.  def finalize(): Unit
    Attributes
      protected[java.lang]
    Definition Classes
      AnyRef
    Annotations
      @throws( classOf[java.lang.Throwable] )
14.  def getArgument(index: Int): scala.Option[Argument]

    Gets an Argument based on its index.

    Gets an Argument based on its index.

    index

      the index, must be positive or zero.

    returns

      the Argument, `null` if not found.see Argument

15.  def getArgument(name: String): scala.Option[Argument]

    Gets an Argument based on its name (argument name).

    Gets an Argument based on its name (argument name).

    name

      the name of the argument, must not be `null`

    returns

      the Argument, `null` if not found.see Argument

16.  def getArguments(): Buffer[Argument]

    Gets the list of defined arguments.

    Gets the list of defined arguments.

    returns

      the list of argument, empty if none.

17.  final def getClass(): Class[_]
    Definition Classes
      AnyRef → Any
    Annotations
      @native()
18.  def getDescription(): scala.Option[String]

    returns

      the CLI description.

19.  def getName(): String

    returns

      the CLI name.

20.  def getOption(name: String): scala.Option[Option]

    Gets an Option based on its name (short name, long name or argument name).

    Gets an Option based on its name (short name, long name or argument name).

    name

      the name, must not be `null`

    returns

      the Option, `null` if not foundsee Option

21.  def getOptions(): Buffer[Option]

    Gets the list of options.

    Gets the list of options.

    returns

      the list of options, empty if none.

22.  def getSummary(): scala.Option[String]

    returns

      the CLI summary.

23.  def hashCode(): Int
    Definition Classes
      AnyRef → Any
    Annotations
      @native()
24.  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.

    returns

      `true` if the current CLI is hidden, false otherwise

25.  final def isInstanceOf[T0]: Boolean
    Definition Classes
      Any
26.  final def ne(arg0: AnyRef): Boolean
    Definition Classes
      AnyRef
27.  final def notify(): Unit
    Definition Classes
      AnyRef
    Annotations
      @native()
28.  final def notifyAll(): Unit
    Definition Classes
      AnyRef
    Annotations
      @native()
29.  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.

    arguments

      the arguments

    validate

      enable / disable parsing validation

    returns

      the creates command line

30.  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.

    arguments

      the arguments

    returns

      the creates command line

31.  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.

    index

      the argument index

    returns

      the current CLI instance

32.  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.

    name

      the option name

    returns

      the current CLI instance

33.  def setArguments(args: Buffer[Argument]): CLI

    Sets the list of arguments.

    Sets the list of arguments.

    args

      the list of arguments, must not be `null`

    returns

      the current CLI instance

34.  def setDescription(desc: String): CLI
35.  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.

    hidden

      enables or disables the hidden aspect of the CI

    returns

      the current CLI instance

36.  def setName(name: String): CLI

    Sets the name of the CLI.

    Sets the name of the CLI.

    name

      the name

    returns

      the current CLI instance

37.  def setOptions(options: Buffer[Option]): CLI

    Sets the list of arguments.

    Sets the list of arguments.

    options

      the list of options, must not be `null`

    returns

      the current CLI instance

38.  def setSummary(summary: String): CLI

    Sets the summary of the CLI.

    Sets the summary of the CLI.

    summary

      the summary

    returns

      the current CLI instance

39.  final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
      AnyRef
40.  def toString(): String
    Definition Classes
      AnyRef → Any
41.  final def wait(): Unit
    Definition Classes
      AnyRef
    Annotations
      @throws( ... )
42.  final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
      AnyRef
    Annotations
      @throws( ... )
43.  final def wait(arg0: Long): Unit
    Definition Classes
      AnyRef
    Annotations
      @native() @throws( ... )

### Inherited from AnyRef

### Inherited from Any

### Ungrouped