com.twitter.common.args
Annotation Type CmdLine


@Target(value=FIELD)
@Retention(value=RUNTIME)
public @interface CmdLine

Annotation for a command line argument.


Required Element Summary
 String help
          The help string to display on the command line in a usage message.
 String name
          The short name of the argument, as supplied on the command line.
 
Optional Element Summary
 Class<? extends Parser> parser
          The parser class to use for parsing this argument.
 

Element Detail

name

public abstract String name
The short name of the argument, as supplied on the command line. The argument can also be accessed by the canonical name, which is com.foo.bar.MyArgClass.arg_name. If the global scope contains more than one argument with the same name, all colliding arguments must be disambiguated with the canonical form. The argument name must match the format [\w\-\.]+.

Returns:
The argument name.

help

public abstract String help
The help string to display on the command line in a usage message.

Returns:
Help string.

parser

public abstract Class<? extends Parser> parser
The parser class to use for parsing this argument. The parser must return the same type as the field being annotated.

Returns:
Custom parser for this type.
Default:
com.twitter.common.args.Parser.class