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.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final org.apache.commons.cli.Option
The Help optionstatic final org.apache.commons.cli.Option
Provide license definition listingstatic final Comparator
<org.apache.commons.cli.Option> The Option comparator to sort the help -
Method Summary
Modifier and TypeMethodDescriptionstatic org.apache.commons.cli.Options
Create anOptions
object from the list of defined Options.Gets the mapping ofargName(value)
values to a description of those values.static ReportConfiguration
parseCommands
(File workingDirectory, String[] args, Consumer<org.apache.commons.cli.Options> helpCmd) Parses the standard options to create a ReportConfiguration.static ReportConfiguration
parseCommands
(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 -
HELP_LICENSES
public static final org.apache.commons.cli.Option HELP_LICENSESProvide license definition listing
-
-
Method Details
-
getArgumentTypes
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 IOException Parses 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 null if 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 IOException Parses 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
- If true then the commands do not need extra arguments- Returns:
- a ReportConfiguration or
null
if Help was printed. - Throws:
IOException
- on error.
-
buildOptions
public static org.apache.commons.cli.Options buildOptions()Create anOptions
object 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.
-