net.dpml.cli.commandline
public class Parser extends Object
Parser
interface can parse a
String array according to the Groupspecified and return a
CommandLine.
Version: @PROJECT-VERSION@
Method Summary | |
---|---|
CommandLine | parse(String[] arguments)
Parse the arguments according to the specified options and properties.
|
CommandLine | parseAndHelp(String[] arguments)
Parse the arguments according to the specified options and properties and
displays the usage screen if the CommandLine is not valid or the help
option was specified.
|
void | setGroup(Group group)
Sets the Group of options to parse against |
void | setHelpFormatter(HelpFormatter helpFormatter)
Sets the HelpFormatter to use with the simplified parsing. |
void | setHelpOption(Option helpOption)
Sets the help option to use with the simplified parsing. |
void | setHelpTrigger(String helpTrigger)
Sets the help option to use with the simplified parsing. |
Parameters: arguments the command line arguments
Returns: the list of atomic option and value tokens
Throws: OptionException if there are any problems encountered while parsing the command line tokens.
Parameters: arguments the command line arguments
Returns: a valid CommandLine or null if the parse was unsuccessful
Throws: IOException if an error occurs while formatting help
Parameters: group the group of options to parse against
Parameters: helpFormatter the HelpFormatter to use with the simplified parsing
See Also: (String[])
--help
, -h
and -?
are often used.Parameters: helpOption the help Option
See Also: (String[])
--help
, -h
and -?
are often used.Parameters: helpTrigger the trigger of the help Option
See Also: (String[])