Package: io.vertx.groovy.core.cli

## [Groovy] Class CommandLine

- io.vertx.groovy.core.cli.CommandLine

- The parser transforms a CLI (a model) into an CommandLine. This CommandLine has stored the argument and option values. Only instance of parser should create objects of this type.

- - ### Constructor Summary

    Constructors
    Constructor and description
    `CommandLine (java.lang.Object delegate)`

  - ### Methods Summary

    Methods
    Type | Name and description
    --- | ---
    `boolean` | `acceptMoreValues(java.util.Map<java.lang.String, java.lang.Object> option = [:])` Checks whether or not the given option accept more values.
    `java.util.List<java.lang.String>` | `allArguments()` Returns: the ordered list of arguments.
    `CLI` | `cli()` @return the model of this command line object.
    `static CommandLine` | `create(CLI cli)` Creates a command line object from the CLI.
    `T` | `getArgumentValue(java.lang.String name)` Gets the value of an argument with the matching name (arg name).
    `T` | `getArgumentValue(int index)` Gets the value of an argument with the given index.
    `java.lang.Object` | `getDelegate()`
    `T` | `getOptionValue(java.lang.String name)` Gets the value of an option with the matching name (can be the long name, short name or arg name).
    `java.lang.String` | `getRawValueForArgument(java.util.Map<java.lang.String, java.lang.Object> arg = [:])` Gets the raw value of the given argument.
    `java.lang.String` | `getRawValueForOption(java.util.Map<java.lang.String, java.lang.Object> option = [:])` Gets the raw value of the given option.
    `java.util.List<java.lang.String>` | `getRawValues(java.util.Map<java.lang.String, java.lang.Object> option = [:])` Gets the raw values of the given option.
    `java.util.List<java.lang.String>` | `getRawValuesForArgument(java.util.Map<java.lang.String, java.lang.Object> argument = [:])` Gets the raw values of the given argument.
    `java.util.List<java.lang.String>` | `getRawValuesForOption(java.util.Map<java.lang.String, java.lang.Object> option = [:])` Gets the raw values of the given option.
    `boolean` | `isArgumentAssigned(java.util.Map<java.lang.String, java.lang.Object> arg = [:])` Checks whether or not the given argument has been assigned in the command line.
    `boolean` | `isAskingForHelp()` Checks whether or not the user has passed a "help" option and is asking for help.
    `boolean` | `isFlagEnabled(java.lang.String name)` Gets the value of an option marked as a flag.
    `boolean` | `isOptionAssigned(java.util.Map<java.lang.String, java.lang.Object> option = [:])` Checks whether or not the given option has been assigned in the command line.
    `boolean` | `isSeenInCommandLine(java.util.Map<java.lang.String, java.lang.Object> option = [:])` Checks whether or not the given option has been seen in the user command line.
    `boolean` | `isValid()` Checks whether or not the command line is valid, i.e. all constraints from arguments and options have been satisfied.

  - ### Inherited Methods Summary

    Inherited Methods
    Methods inherited from class | Name
    --- | ---
    `class java.lang.Object` | `java.lang.Object#wait(long, int), java.lang.Object#wait(long), java.lang.Object#wait(), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll()`

- - ### Constructor Detail

    - #### CommandLine(java.lang.Object delegate)

  - ### Method Detail

    - #### boolean acceptMoreValues(java.util.Map<java.lang.String, java.lang.Object> option = [:])

      Checks whether or not the given option accept more values.

      Returns:
        if the option accepts more values, otherwise.
      Parameters:
        `option` - the option (see Option)

    - #### java.util.List<java.lang.String> allArguments()

      Returns:
        the ordered list of arguments. Arguments are command line arguments not matching an option.

    - #### CLI cli()

      Returns:
        the model of this command line object.

    - #### static CommandLine create(CLI cli)

      Creates a command line object from the CLI. This object is intended to be used by the parser to set the argument and option values.

      Returns:
        the command line object
      Parameters:
        `cli` - the CLI definition

    - #### T getArgumentValue(java.lang.String name)

      Gets the value of an argument with the matching name (arg name).

      Returns:
        the value, `null` if not set
      Parameters:
        `name` - the name

    - #### T getArgumentValue(int index)

      Gets the value of an argument with the given index.

      Returns:
        the value, `null` if not set
      Parameters:
        `index` - the index

    - #### java.lang.Object getDelegate()

    - #### T getOptionValue(java.lang.String name)

      Gets the value of an option with the matching name (can be the long name, short name or arg name).

      Returns:
        the value, `null` if not set
      Parameters:
        `name` - the name

    - #### java.lang.String getRawValueForArgument(java.util.Map<java.lang.String, java.lang.Object> arg = [:])

      Gets the raw value of the given argument. Raw values are the values as given in the user command line.

      Returns:
        the value, `null` if none.
      Parameters:
        `arg` - the argument (see Argument)

    - #### java.lang.String getRawValueForOption(java.util.Map<java.lang.String, java.lang.Object> option = [:])

      Gets the raw value of the given option. Raw values are the values as given in the user command line.

      Returns:
        the value, `null` if none.
      Parameters:
        `option` - the option (see Option)

    - #### java.util.List<java.lang.String> getRawValues(java.util.Map<java.lang.String, java.lang.Object> option = [:])

      Gets the raw values of the given option. Raw values are simple "String", not converted to the option type.

      Returns:
        the list of values, empty if none
      Parameters:
        `option` - the option (see Option)

    - #### java.util.List<java.lang.String> getRawValuesForArgument(java.util.Map<java.lang.String, java.lang.Object> argument = [:])

      Gets the raw values of the given argument. Raw values are simple "String", not converted to the argument type.

      Returns:
        the list of values, empty if none
      Parameters:
        `argument` - the argument (see Argument)

    - #### java.util.List<java.lang.String> getRawValuesForOption(java.util.Map<java.lang.String, java.lang.Object> option = [:])

      Gets the raw values of the given option. Raw values are simple "String", not converted to the option type.

      Returns:
        the list of values, empty if none
      Parameters:
        `option` - the option (see Option)

    - #### boolean isArgumentAssigned(java.util.Map<java.lang.String, java.lang.Object> arg = [:])

      Checks whether or not the given argument has been assigned in the command line.

      Returns:
        `true` if the argument has received a value, otherwise.
      Parameters:
        `arg` - the argument (see Argument)

    - #### boolean isAskingForHelp()

      Checks whether or not the user has passed a "help" option and is asking for help.

      Returns:
        `true` if the user command line has enabled a "Help" option, otherwise.

    - #### boolean isFlagEnabled(java.lang.String name)

      Gets the value of an option marked as a flag.

      Calling this method an a non-flag option throws an java.lang.IllegalStateException.
      Returns:
        `true` if the flag has been set in the command line, `false` otherwise.
      Parameters:
        `name` - the option name

    - #### boolean isOptionAssigned(java.util.Map<java.lang.String, java.lang.Object> option = [:])

      Checks whether or not the given option has been assigned in the command line.

      Returns:
        `true` if the option has received a value, otherwise.
      Parameters:
        `option` - the option (see Option)

    - #### boolean isSeenInCommandLine(java.util.Map<java.lang.String, java.lang.Object> option = [:])

      Checks whether or not the given option has been seen in the user command line.

      Returns:
        `true` if the user command line has used the option
      Parameters:
        `option` - the option (see Option)

    - #### boolean isValid()

      Checks whether or not the command line is valid, i.e. all constraints from arguments and options have been satisfied. This method is used when the parser validation is disabled.

      Returns:
        `true` if the current CommandLine object is valid. otherwise.