Annotation Interface CmdArgument


@Retention(RUNTIME) @Target(FIELD) @interface CmdArgument
Annotation for command line parsing. This is a copy from
invalid @link
{@link https://github.com/rjeschke/neetutils-base
}.
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    boolean
    Set to true to set this as a catch-all argument.
    A description for this argument.
    boolean
    Set to true if this is a switch.
    Long name for argument.
    char
    List item separator.
    Class for List-type arguments.
    boolean
    Set to false to disable automatic default value printing for this argument.
    boolean
    Set to true if this is a required argument.
    char
    Short name (character) for argument.
  • Element Details

    • l

      Long name for argument. Default is 'none'. Either one or both of l, s need to be provided.
      Default:
      ""
    • s

      char s
      Short name (character) for argument. Default is 'none'. Either one or both of l, s need to be provided.
      Default:
      '\u0000'
    • desc

      String desc
      A description for this argument. Default is 'none'.
      Default:
      ""
    • listSep

      char listSep
      List item separator. Default is ','.
      Default:
      ','
    • listType

      Class<?> listType
      Class for List-type arguments. Default is String.class.
      Default:
      java.lang.String.class
    • isSwitch

      boolean isSwitch
      Set to true if this is a switch. Requires a boolean field which gets set to true when this argument is provided.
      Default:
      false
    • required

      boolean required
      Set to true if this is a required argument.
      Default:
      false
    • catchAll

      boolean catchAll
      Set to true to set this as a catch-all argument. Requires a List field and will parse all arguments following this switch into the list.
      Default:
      false
    • printDefault

      boolean printDefault
      Set to false to disable automatic default value printing for this argument.
      Default:
      true