|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: REQUIRED | OPTIONAL | DETAIL: ELEMENT |
@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. |
public abstract String[] name
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.
public abstract char[] abbr
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.
public abstract String desc
public abstract CommandLineParser.OptionSpec.ArgSpec arg
public abstract String argName
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: REQUIRED | OPTIONAL | DETAIL: ELEMENT |