Annotation Type CmdArgument


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

      Optional Elements 
      Modifier and Type Optional Element Description
      boolean catchAll
      Set to true to set this as a catch-all argument.
      java.lang.String desc
      A description for this argument.
      boolean isSwitch
      Set to true if this is a switch.
      java.lang.String l
      Long name for argument.
      char listSep
      List item separator.
      java.lang.Class<?> listType
      Class for List-type arguments.
      boolean printDefault
      Set to false to disable automatic default value printing for this argument.
      boolean required
      Set to true if this is a required argument.
      char s
      Short name (character) for argument.
    • Element Detail

      • l

        java.lang.String 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

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

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

        java.lang.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