Package org.apache.commons.cli.avalon
Class CLArgsParser
java.lang.Object
org.apache.commons.cli.avalon.CLArgsParser
Parser for command line arguments.
 This parses command lines according to the standard (?) of GNU utilities.
 Note: This is still used in 1.1 libraries so do not add 1.2+ dependencies.
 Note that CLArgs uses a backing hashtable for the options index and so
 duplicate arguments are only returned by getArguments().
- See Also:
- 
Constructor SummaryConstructorsConstructorDescriptionCLArgsParser(String[] args, CLOptionDescriptor[] optionDescriptors) Create a parser that deals with options and parses certain args.CLArgsParser(String[] args, CLOptionDescriptor[] optionDescriptors, ParserControl control) Create a parser that can deal with options and parses certain args.
- 
Method SummaryModifier and TypeMethodDescriptionfinal CLOptiongetArgumentById(int id) Retrieve theCLOptionwith specified id, ornullif no command line option is found.final CLOptiongetArgumentByName(String name) Retrieve theCLOptionwith specified name, ornullif no command line option is found.Retrieve a list of options that were parsed from command list.final StringRetrieve an error message that occurred during parsing if one existed.final String[]Retrieve an array of arguments that have not been parsed due to the parser halting.
- 
Constructor Details- 
CLArgsParserCreate a parser that can deal with options and parses certain args.- Parameters:
- args- the args, typically that passed to the- public static void main(String[] args)method.
- optionDescriptors- the option descriptors
- control- the parser control used determine behaviour of parser
 
- 
CLArgsParserCreate a parser that deals with options and parses certain args.- Parameters:
- args- the args
- optionDescriptors- the option descriptors
 
 
- 
- 
Method Details- 
getUnparsedArgsRetrieve an array of arguments that have not been parsed due to the parser halting.- Returns:
- an array of unparsed args
 
- 
getArgumentsRetrieve a list of options that were parsed from command list.- Returns:
- the list of options
 
- 
getArgumentByIdRetrieve theCLOptionwith specified id, ornullif no command line option is found.
- 
getArgumentByNameRetrieve theCLOptionwith specified name, ornullif no command line option is found.
- 
getErrorStringRetrieve an error message that occurred during parsing if one existed.- Returns:
- the error string
 
 
-