org.apache.commons.cli
Interface CommandLineParser
- BasicParser, GnuParser, Parser, PosixParser
public interface CommandLineParser
A class that implements the
CommandLineParser interface
can parse a String array according to the
Options specified
and return a
CommandLine.
- John Keyes (john at integralsource.com)
CommandLine | parse(Options options, String[] arguments)- Parse the arguments according to the specified options.
|
CommandLine | parse(Options options, String[] arguments, boolean stopAtNonOption)- Parse the arguments according to the specified options.
|
parse
public CommandLine parse(Options options,
String[] arguments)
throws ParseException Parse the arguments according to the specified options.
options - the specified Optionsarguments - the command line arguments
- the list of atomic option and value tokens
ParseException - if there are any problems encountered
while parsing the command line tokens.
parse
public CommandLine parse(Options options,
String[] arguments,
boolean stopAtNonOption)
throws ParseException Parse the arguments according to the specified options.
options - the specified Optionsarguments - the command line argumentsstopAtNonOption - specifies whether to continue parsing the
arguments if a non option is encountered.
- the list of atomic option and value tokens
ParseException - if there are any problems encountered
while parsing the command line tokens.