Package org.apache.rat
Class OptionCollectionParser<T extends UIOption<T>>
java.lang.Object
org.apache.rat.OptionCollectionParser<T>
- Type Parameters:
T- The UIOption type that this parser is handling.
Uses the AbstractOptionCollection to parse the command line options.
Contains utility methods to create ReportConfigurations from the options and an array of arguments.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Comparator<org.apache.commons.cli.Option>The Option comparator to sort the help. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic org.apache.commons.cli.CommandLineparseCommandLine(org.apache.commons.cli.Options opts, String[] args) Parse the options into the command line.parseCommands(File workingDirectory, String[] args) Parses the standard options to create a ReportConfiguration.
-
Field Details
-
OPTION_COMPARATOR
The Option comparator to sort the help.
-
-
Constructor Details
-
OptionCollectionParser
Constructor.- Parameters:
optionCollection- the option collection to use for.
-
-
Method Details
-
parseCommands
Parses the standard options to create a ReportConfiguration.- Parameters:
workingDirectory- the directory to resolve relative file names against.args- the arguments to parse.- Returns:
- the ArgumentContext for the process.
- Throws:
RatException- on error.
-
parseCommandLine
public static org.apache.commons.cli.CommandLine parseCommandLine(org.apache.commons.cli.Options opts, String[] args) throws org.apache.commons.cli.ParseException Parse the options into the command line.- Parameters:
opts- the option definitions.args- the argument to apply the definitions to.- Returns:
- the CommandLine
- Throws:
org.apache.commons.cli.ParseException- on option parsing error.
-