Package org.apache.rat
Class OptionCollection
java.lang.Object
org.apache.rat.OptionCollection
The collection of standard options for the CLI as well as utility methods to manage them and methods to create the
ReportConfiguration from the options and an array of arguments.
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic org.apache.commons.cli.OptionThe Help optionstatic Comparator<org.apache.commons.cli.Option>The Option comparator to sort the help -
Method Summary
Modifier and TypeMethodDescriptionstatic org.apache.commons.cli.OptionsCreate anOptionsobject from the list of defined Options.Deprecated.static ReportConfigurationparseCommands(File workingDirectory, String[] args, Consumer<org.apache.commons.cli.Options> helpCmd)Parses the standard options to create a ReportConfiguration.static ReportConfigurationparseCommands(File workingDirectory, String[] args, Consumer<org.apache.commons.cli.Options> helpCmd, boolean noArgs)Parses the standard options to create a ReportConfiguration.
-
Field Details
-
OPTION_COMPARATOR
The Option comparator to sort the help -
HELP
public static final org.apache.commons.cli.Option HELPThe Help option
-
-
Method Details
-
getArgumentTypes
Deprecated.Gets the mapping ofargName(value)values to a description of those values.- Returns:
- the mapping of
argName(value)values to a description of those values.
-
parseCommands
public static ReportConfiguration parseCommands(File workingDirectory, String[] args, Consumer<org.apache.commons.cli.Options> helpCmd) throws IOExceptionParses the standard options to create a ReportConfiguration.- Parameters:
workingDirectory- The directory to resolve relative file names against.args- the arguments to parsehelpCmd- the help command to run when necessary.- Returns:
- a ReportConfiguration or
nullif Help was printed. - Throws:
IOException- on error.
-
parseCommands
public static ReportConfiguration parseCommands(File workingDirectory, String[] args, Consumer<org.apache.commons.cli.Options> helpCmd, boolean noArgs) throws IOExceptionParses the standard options to create a ReportConfiguration.- Parameters:
workingDirectory- The directory to resolve relative file names against.args- the arguments to parsehelpCmd- the help command to run when necessary.noArgs- Iftruethen the commands do not need extra arguments.- Returns:
- a ReportConfiguration or
nullif Help was printed. - Throws:
IOException- on error.
-
buildOptions
public static org.apache.commons.cli.Options buildOptions()Create anOptionsobject from the list of defined Options. Mutually exclusive options must be listed in an OptionGroup.- Returns:
- the Options comprised of the Options defined in this class.
-
OptionCollection.ArgumentType