Claudenw commented on code in PR #299:
URL: https://github.com/apache/creadur-rat/pull/299#discussion_r1750168212
##########
apache-rat-core/src/main/java/org/apache/rat/commandline/Arg.java:
##########
@@ -659,4 +675,66 @@ public static void reset() {
}
}
}
+
+ /**
+ * Finds the Arg that an Option is in.
+ * @param optionToFind the Option to locate.
+ * @return The Arg or {@code null} if no Arg is found.
+ */
+ public static Arg findArg(Option optionToFind) {
+ for (Arg arg : Arg.values()) {
+ for (Option candidate : arg.group.getOptions()) {
+ if (optionToFind.equals(candidate)) {
+ return arg;
+ }
+ }
+ }
+ return null;
+ }
+
+ /**
+ * Finds the Arg that contains an Option with the specified key.
+ * @param key the key for the Option to locate.
+ * @return The Arg or {@code null} if no Arg is found.
+ */
+ public static Arg findArg(String key) {
Review Comment:
Yes. fixed
##########
apache-rat-core/src/main/java/org/apache/rat/commandline/Arg.java:
##########
@@ -659,4 +675,66 @@ public static void reset() {
}
}
}
+
+ /**
+ * Finds the Arg that an Option is in.
+ * @param optionToFind the Option to locate.
+ * @return The Arg or {@code null} if no Arg is found.
+ */
+ public static Arg findArg(Option optionToFind) {
Review Comment:
Yes. fixed
--
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]