CommandLine (Grails 5.2.5)

Package: org.grails.build.parsing

## [Java] Interface CommandLine

-     public interface CommandLine

  Represents the parsed command line options.

  Authors:
    Graeme Rocher
  Since:
    2.0

- - ### Methods Summary

    Methods
    Type Params | Return Type | Name and description
    --- | --- | ---
    `` | `public java.lang.String` | `getCommandName()` Returns: The command name specified
    `` | `public java.lang.String` | `getEnvironment()` Returns: The environment specified
    `` | `public java.lang.String[]` | `getRawArguments()`
    `` | `public java.util.List<java.lang.String>` | `getRemainingArgs()` Returns: The remaining arguments after the command name
    `` | `public java.lang.String[]` | `getRemainingArgsArray()` Returns: The remaining arguments as an array
    `` | `public java.lang.String` | `getRemainingArgsLineSeparated()` Returns: The remaining args separated by the line separator char
    `` | `public java.lang.String` | `getRemainingArgsString()` Returns: The remaining args as one big string
    `` | `public java.lang.String` | `getRemainingArgsWithOptionsString()` Returns: The remaining args as one big string without undeclared options
    `` | `public java.util.Properties` | `getSystemProperties()` Returns: The system properties specified
    `` | `public java.util.Map<java.lang.String, java.lang.Object>` | `getUndeclaredOptions()`
    `` | `public boolean` | `hasOption(java.lang.String name)` Parameters: `name` - The name of the option
    `` | `public boolean` | `isEnvironmentSet()` Returns: Whether the environment is user specified
    `` | `public Map.Entry<java.lang.String, java.lang.Object>` | `lastOption()` Returns: The last specified option
    `` | `public java.lang.String` | `lookupEnvironmentForCommand()`
    `` | `public java.lang.Object` | `optionValue(java.lang.String name)` The value of an option
    `` | `public CommandLine` | `parseNew(java.lang.String[] args)` Parses a new CommandLine instance that combines this instance with the given arguments
    `` | `public void` | `setCommand(java.lang.String scriptName)`

- - ### Method Detail

    - #### public java.lang.String getCommandName()

      Returns:
        The command name specified

    - #### public java.lang.String getEnvironment()

      Returns:
        The environment specified

    - #### public java.lang.String[] getRawArguments()

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

      Returns:
        The remaining arguments after the command name

    - #### public java.lang.String[] getRemainingArgsArray()

      Returns:
        The remaining arguments as an array

    - #### public java.lang.String getRemainingArgsLineSeparated()

      Returns:
        The remaining args separated by the line separator char

    - #### public java.lang.String getRemainingArgsString()

      Returns:
        The remaining args as one big string

    - #### public java.lang.String getRemainingArgsWithOptionsString()

      Returns:
        The remaining args as one big string without undeclared options

    - #### public java.util.Properties getSystemProperties()

      Returns:
        The system properties specified

    - #### public java.util.Map<java.lang.String, java.lang.Object> getUndeclaredOptions()

    - #### public boolean hasOption(java.lang.String name)

      Parameters:
        `name` - The name of the option
      Returns:
        Whether the given option is specified

    - #### public boolean isEnvironmentSet()

      Returns:
        Whether the environment is user specified

    - #### public Map.Entry<java.lang.String, java.lang.Object> lastOption()

      Returns:
        The last specified option

    - #### public java.lang.String lookupEnvironmentForCommand()

    - #### public java.lang.Object optionValue(java.lang.String name)

      The value of an option

      Parameters:
        `name` - The option
      Returns:
        The value

    - #### public CommandLine parseNew(java.lang.String[] args)

      Parses a new CommandLine instance that combines this instance with the given arguments

      Parameters:
        `args` - The arguments
      Returns:
        A new CommandLine instance

    - #### public void setCommand(java.lang.String scriptName)