util
Annotation Type CommandLineParser.OptionSpec.Option


@Target(value=FIELD)
@Retention(value=RUNTIME)
@Documented
public static @interface CommandLineParser.OptionSpec.Option

The annotation giving syntactic specifications for a command-line option. Each enum constant in an OptionSpec enum must carry one.

For example, for a program whose --verbose option takes an optional argument specifying a level of verbosity:

@Option(name={"verbose", "verbosity"}, abbr='v',
        desc="increase level of output (to LEVEL if given)",
        arg=ArgSpec.OPTIONAL, argName="LEVEL")
 VERBOSITY { ... }


Optional Element Summary
 char[] abbr
          The one-character abbreviation for the option.
 CommandLineParser.OptionSpec.ArgSpec arg
          An enum constant specifying whether the option takes an argument, and whether that argument is optional.
 String argName
          The name of the argument, as it will be shown in the "--help" output for the option.
 String desc
          A brief description of the option, to be included in the "--help" output.
 String[] name
          The full, long-form name of the option.
 

name

public abstract String[] name
The full, long-form name of the option. Excludes the leading "--" used in the command line.

An array can be given, specifying multiple synonymous names. The first name given will be used in error message output.

The default is to have no long-form name; such an option can only be given by its short form.

Default:
{}

abbr

public abstract char[] abbr
The one-character abbreviation for the option. Excludes the leading dash used in the command line.

An array can be given, specifying multiple synonymous abbreviations.

The default is to have no abbreviation; such an option can only be given by its full form.

Default:
{}

desc

public abstract String desc
A brief description of the option, to be included in the "--help" output.

Default:
""

arg

public abstract CommandLineParser.OptionSpec.ArgSpec arg
An enum constant specifying whether the option takes an argument, and whether that argument is optional.

Default:
NONE

argName

public abstract String argName
The name of the argument, as it will be shown in the "--help" output for the option.

Default:
"ARG"