CommandDescription (Grails 4.0.3)
Date: 2020-04-03

Package: org.grails.cli.profile

## [Groovy] Class CommandDescription

- org.grails.cli.profile.CommandDescription

- Describes a Command

  Authors:
    Graeme Rocher
  Since:
    3.0

- - ### Properties Summary

    Properties
    Type | Name and description
    --- | ---
    `jline.console.completer.Completer` | `completer` A completer for the command
    `java.lang.String` | `description` The description of the command
    `java.lang.String` | `name` The name of the command
    `java.util.Collection<java.lang.String>` | `synonyms` Any names that should also map to this command
    `java.lang.String` | `usage` The usage instructions for the command

  - ### Methods Summary

    Methods
    Type Params | Return Type | Name and description
    --- | --- | ---
    `` | `CommandDescription` | `argument(java.util.Map args)` Adds an argument for the given named arguments
    `` | `CommandDescription` | `completer(java.lang.Class<jline.console.completer.Completer> completer)` Sets the completer
    `` | `CommandDescription` | `completer(jline.console.completer.Completer completer)` Sets the completer
    `` | `CommandDescription` | `flag(java.util.Map args)` Adds a flag for the given named arguments
    `` | `CommandArgument` | `getArgument(java.lang.String name)` Returns an argument for the given name or null if it doesn't exist
    `` | `java.util.Collection<CommandArgument>` | `getArguments()` Arguments to the command
    `` | `CommandArgument` | `getFlag(java.lang.String name)` Returns a flag for the given name or null if it doesn't exist
    `` | `java.util.Collection<CommandArgument>` | `getFlags()` Flags to the command.
    `` | `CommandDescription` | `synonyms(java.lang.String... synonyms)` Adds a synonyms for this command

  - ### 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()`

- - ### Property Detail

    - #### jline.console.completer.Completer completer

      A completer for the command

    - #### java.lang.String description

      The description of the command

    - #### java.lang.String name

      The name of the command

    - #### java.util.Collection<java.lang.String> synonyms

      Any names that should also map to this command

    - #### java.lang.String usage

      The usage instructions for the command

  - ### Method Detail

    - #### @groovy.transform.CompileDynamic CommandDescription argument(java.util.Map args)

      Adds an argument for the given named arguments

      Parameters:
        `args` - The named arguments

    - #### CommandDescription completer(java.lang.Class<jline.console.completer.Completer> completer)

      Sets the completer

      Parameters:
        `completer` - The class of the completer to set
      Returns:
        The description instance

    - #### CommandDescription completer(jline.console.completer.Completer completer)

      Sets the completer

      Parameters:
        `completer` - The completer to set
      Returns:
        The description instance

    - #### @groovy.transform.CompileDynamic CommandDescription flag(java.util.Map args)

      Adds a flag for the given named arguments

      Parameters:
        `args` - The named arguments

    - #### CommandArgument getArgument(java.lang.String name)

      Returns an argument for the given name or null if it doesn't exist

      Parameters:
        `name` - The name
      Returns:
        The argument or null

    - #### java.util.Collection<CommandArgument> getArguments()

      Arguments to the command

    - #### CommandArgument getFlag(java.lang.String name)

      Returns a flag for the given name or null if it doesn't exist

      Parameters:
        `name` - The name
      Returns:
        The argument or null

    - #### java.util.Collection<CommandArgument> getFlags()

      Flags to the command. These differ as they are optional and are prefixed with a hyphen (Example -debug)

    - #### CommandDescription synonyms(java.lang.String... synonyms)

      Adds a synonyms for this command

      Parameters:
        `synonyms` - The synonyms
      Returns:
        This command description