Package org.apache.rat.commandline
Enum Arg
- All Implemented Interfaces:
Serializable
,Comparable<Arg>
An enumeration of options.
Each Arg contains an OptionGroup that contains the individual options that all resolve to the same option. This allows us to deprecate options as we move forward in development.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final class
Standard messages used in descriptions. -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionGroup of options that read a configuration fileGroup of options that skip the default configuration fileOption to specify an acceptable number of various counters.Option to specify an acceptable number of various counters.Stop processing an input stream and declare an input file.Specifies that the run should not perform any updates to files.Defines options to add licenses to filesDefines options to add copyright to filesCauses file updates to overwrite existing files.Excludes files by expressionExcludes files based on contents of a file.Excludes files based on SCM exclusion file processing.Excludes files if they are smaller than the given threshold.Excludes files based on standard groupings.Option that specifies approved license familiesOption that specifies approved license families from a fileOption to list license families to remove from the approved list.Option to read a list of license families to remove from the approved list.Provide license definition listing of registered licenses.Excludes files by expression.Includes files based on contents of a file.Includes files based on standard groups.Option that adds approved licenses to the listOption that adds approved licenses from a fileOption to remove licenses from the approved listOption to read a file licenses to be removed from the approved list.Specifies the log level to log messages at.Specifies the level of reporting detail for archive files.Specifies the license families that should be included in the output.Specifies where the output should be written.Specifies the license definitions that should be included in the output.Specifies the level of reporting detail for standard files.Defines the stylesheet to use.Reads files to test from file. -
Method Summary
Modifier and TypeMethodDescriptionGets the default value for this arg.org.apache.commons.cli.Option
Finds the element associated with the key within the element group.static Arg
Finds the Arg that contains an Option with the specified key.static Arg
findArg
(org.apache.commons.cli.Option optionToFind) Finds the Arg that an Option is in.static org.apache.commons.cli.Options
Gets the full set of options.org.apache.commons.cli.Option
Gets the select element from the group.org.apache.commons.cli.OptionGroup
group()
Gets the group for this arg.boolean
Determines if the group has a selected element.org.apache.commons.cli.Option
option()
Returns the first non-deprecated option from the group.static void
processArgs
(ArgumentContext context) Process the arguments.static void
processLogLevel
(org.apache.commons.cli.CommandLine commandLine) Process the log level setting.static void
reset()
Resets the groups in the Args so that they are unused and ready to detect the next set of arguments.static Arg
Returns the enum constant of this type with the specified name.static Arg[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
Enum Constant Details
-
EDIT_COPYRIGHT
Defines options to add copyright to files -
EDIT_OVERWRITE
Causes file updates to overwrite existing files. -
EDIT_ADD
Defines options to add licenses to files -
CONFIGURATION
Group of options that read a configuration file -
CONFIGURATION_NO_DEFAULTS
Group of options that skip the default configuration file -
LICENSES_APPROVED
Option that adds approved licenses to the list -
LICENSES_APPROVED_FILE
Option that adds approved licenses from a file -
FAMILIES_APPROVED
Option that specifies approved license families -
FAMILIES_APPROVED_FILE
Option that specifies approved license families from a file -
LICENSES_DENIED
Option to remove licenses from the approved list -
LICENSES_DENIED_FILE
Option to read a file licenses to be removed from the approved list. -
FAMILIES_DENIED
Option to list license families to remove from the approved list. -
FAMILIES_DENIED_FILE
Option to read a list of license families to remove from the approved list. -
COUNTER_MAX
Option to specify an acceptable number of various counters. -
COUNTER_MIN
Option to specify an acceptable number of various counters. -
SOURCE
Reads files to test from file. -
EXCLUDE
Excludes files by expression -
EXCLUDE_FILE
Excludes files based on contents of a file. -
EXCLUDE_STD
Excludes files based on standard groupings. -
EXCLUDE_SIZE
Excludes files if they are smaller than the given threshold. -
INCLUDE
Excludes files by expression. -
INCLUDE_FILE
Includes files based on contents of a file. -
INCLUDE_STD
Includes files based on standard groups. -
EXCLUDE_PARSE_SCM
Excludes files based on SCM exclusion file processing. -
DIR
Stop processing an input stream and declare an input file. -
OUTPUT_STYLE
Defines the stylesheet to use. -
OUTPUT_LICENSES
Specifies the license definitions that should be included in the output. -
OUTPUT_FAMILIES
Specifies the license families that should be included in the output. -
LOG_LEVEL
Specifies the log level to log messages at. -
DRY_RUN
Specifies that the run should not perform any updates to files. -
OUTPUT_FILE
Specifies where the output should be written. -
OUTPUT_ARCHIVE
Specifies the level of reporting detail for archive files. -
OUTPUT_STANDARD
Specifies the level of reporting detail for standard files. -
HELP_LICENSES
Provide license definition listing of registered licenses.
-
-
Method Details
-
values
Returns an array containing the constants of this enum type, in the order they are declared.- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is null
-
isSelected
public boolean isSelected()Determines if the group has a selected element.- Returns:
true
if the group has a selected element.
-
getSelected
public org.apache.commons.cli.Option getSelected()Gets the select element from the group.- Returns:
- the selected element or
null
if no element is selected.
-
find
Finds the element associated with the key within the element group.- Parameters:
key
- the key to search for.- Returns:
- the matching Option.
- Throws:
IllegalArgumentException
- if the key can not be found.
-
defaultValue
Gets the default value for this arg.- Returns:
- default value of this arg.
-
group
public org.apache.commons.cli.OptionGroup group()Gets the group for this arg.- Returns:
- the option group for this arg.
-
option
public org.apache.commons.cli.Option option()Returns the first non-deprecated option from the group.- Returns:
- the first non-deprecated option or
null
if no non-deprecated option is available.
-
getOptions
public static org.apache.commons.cli.Options getOptions()Gets the full set of options.- Returns:
- the full set of options for this Arg.
-
processLogLevel
public static void processLogLevel(org.apache.commons.cli.CommandLine commandLine) Process the log level setting.- Parameters:
commandLine
- The command line to process.
-
processArgs
Process the arguments.- Parameters:
context
- the context in which to process the args.- Throws:
ConfigurationException
- on error
-
reset
public static void reset()Resets the groups in the Args so that they are unused and ready to detect the next set of arguments. -
findArg
Finds the Arg that an Option is in.- Parameters:
optionToFind
- the Option to locate.- Returns:
- The Arg or
null
if no Arg is found.
-
findArg
Finds the Arg that contains an Option with the specified key.- Parameters:
key
- the key for the Option to locate.- Returns:
- The Arg or
null
if no Arg is found.
-