org.kohsuke.args4j
Interface CmdLineOption

All Known Implementing Classes:
AliasOption, BooleanOption, FileOption, IntOption, MultiStringOption, OutputStreamOption, StringOption

public interface CmdLineOption

A command line option.

This object is responsible for parsing a particular option and storing the parsed result.

Author:
Kohsuke Kawaguchi (kk@kohsuke.org)

Nested Class Summary
static interface CmdLineOption.Parameters
          SPI for CmdLineOption.
 
Method Summary
 boolean accepts(String optionName)
          Checks if this option parser recognizes the specified option name.
 int parseArguments(CmdLineParser parser, CmdLineOption.Parameters params)
          Called if the option that this parser recognizes is found.
 

Method Detail

accepts

boolean accepts(String optionName)
Checks if this option parser recognizes the specified option name.


parseArguments

int parseArguments(CmdLineParser parser,
                   CmdLineOption.Parameters params)
                   throws CmdLineException
Called if the option that this parser recognizes is found.

Parameters:
parser - The parser that's using this option object. For example, if the option "-quiet" is simply an alias to "-verbose 5", then the implementation can just call the CmdLineParser.parse(String[]) method recursively.
params - The rest of the arguments. This method can use this object to access the arguments of the option if necessary.
Returns:
The number of arguments consumed. For example, return 0 if this option doesn't take any parameter.
Throws:
CmdLineException


Copyright © 2003-2010 Kohsuke Kawaguchi. All Rights Reserved.