Package org.apache.axis.utils
Class CLArgsParser
java.lang.Object
org.apache.axis.utils.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.
- Since:
- 4.0
- Author:
- Peter Donald
-
Constructor Summary
ConstructorsConstructorDescriptionCLArgsParser
(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 Summary
Modifier and TypeMethodDescriptionfinal CLOption
getArgumentById
(int id) Retrieve theCLOption
with specified id, ornull
if no command line option is found.final CLOption
getArgumentByName
(String name) Retrieve theCLOption
with specified name, ornull
if no command line option is found.final Vector
Retrieve a list of options that were parsed from command list.final String
Retrieve an error message that occured during parsing if one existed.final String[]
-
Constructor Details
-
CLArgsParser
Create a parser that can deal with options and parses certain args.- Parameters:
args
- the args, typically that passed to thepublic static void main(String[] args)
method.optionDescriptors
- the option descriptors
-
CLArgsParser
Create a parser that deals with options and parses certain args.- Parameters:
args
- the argsoptionDescriptors
- the option descriptors
-
-
Method Details
-
getUnparsedArgs
-
getArguments
Retrieve a list of options that were parsed from command list.- Returns:
- the list of options
-
getArgumentById
Retrieve theCLOption
with specified id, ornull
if no command line option is found.- Parameters:
id
- the command line option id- Returns:
- the
CLOption
with the specified id, ornull
if no CLOption is found. - See Also:
-
getArgumentByName
Retrieve theCLOption
with specified name, ornull
if no command line option is found.- Parameters:
name
- the command line option name- Returns:
- the
CLOption
with the specified name, ornull
if no CLOption is found. - See Also:
-
getErrorString
Retrieve an error message that occured during parsing if one existed.- Returns:
- the error string
-