Claudenw commented on code in PR #637:
URL: https://github.com/apache/creadur-rat/pull/637#discussion_r3325437182
##########
apache-rat-core/src/main/java/org/apache/rat/commandline/Arg.java:
##########
@@ -475,51 +653,66 @@ public enum Arg {
.addOption(Option.builder().longOpt("output-standard").hasArg().argName("ProcessingType")
.desc("Specifies the level of detail in STANDARD file
reporting.")
.converter(s ->
ReportConfiguration.Processing.valueOf(s.toUpperCase()))
- .build())),
+ .build()),
+ (context, selected) -> {
+ try {
+
context.getConfiguration().setStandardProcessing(context.getCommandLine().getParsedOptionValue(selected));
+ } catch (ParseException e) {
+ context.logParseException(e, selected,
Defaults.STANDARD_PROCESSING);
+ }
+ }),
/**
* Provide license definition listing of registered licenses.
*/
HELP_LICENSES(new OptionGroup()
.addOption(Option.builder().longOpt("help-licenses") //
- .desc("Print information about registered
licenses.").build()));
+ .desc("Print information about registered
licenses.").build()),
+ Arg::doNotExecute
+ );
- /** The option group for the argument */
+ /**
+ * The option group for the argument
+ */
private final OptionGroup group;
+ /**
+ * The BiConsumer to apply the option to update the state of the
context.configuration.
+ */
+ private final BiConsumer<ArgumentContext, Option> process;
+
+
+ private static void doNotExecute(final ArgumentContext context, final
Option selected) {
+ throw new ImplementationException(String.format("'%s' should not be
executed directly", selected));
Review Comment:
Added javadoc to explain what this method does.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]