Annotation Type CommandLine.Option

Enclosing class:
CommandLine

@Retention(CLASS) @Target(FIELD) public static @interface CommandLine.Option
Marks a field that receives an option.
  • Required Element Summary

    Required Elements
    Modifier and Type
    Required Element
    Description
    The option's names, such as -v and --verbose.
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    How many values one occurrence takes: 1, 0..1, 1..*.
    A converter for a type the build does not convert by itself.
    The value used when the option is absent.
    Help text.
    boolean
    Leaves the option out of the help.
    boolean
    Whether --no-<name> sets a boolean to false.
    The placeholder printed for the value.
    boolean
    Whether a command line without the option is an error.
    A separator that splits one value into several, such as ,.
  • Element Details

    • names

      String[] names
      The option's names, such as -v and --verbose.
    • description

      String[] description
      Help text.
      Default:
      {}
    • required

      boolean required
      Whether a command line without the option is an error.
      Default:
      false
    • arity

      String arity
      How many values one occurrence takes: 1, 0..1, 1..*.
      Default:
      ""
    • paramLabel

      String paramLabel
      The placeholder printed for the value.
      Default:
      ""
    • defaultValue

      String defaultValue
      The value used when the option is absent. ${env:NAME} reads an environment variable.
      Default:
      ""
    • negatable

      boolean negatable
      Whether --no-<name> sets a boolean to false.
      Default:
      false
    • split

      String split
      A separator that splits one value into several, such as ,.
      Default:
      ""
    • hidden

      boolean hidden
      Leaves the option out of the help.
      Default:
      false
    • converter

      Class<?> converter
      A converter for a type the build does not convert by itself.
      Default:
      void.class