dajac commented on a change in pull request #11008:
URL: https://github.com/apache/kafka/pull/11008#discussion_r668805752



##########
File path: core/src/main/scala/kafka/tools/ConsoleConsumer.scala
##########
@@ -315,11 +321,23 @@ object ConsoleConsumer extends Logging {
 
     formatter.configure(formatterArgs.asScala.asJava)
 
-    val topicOrFilterOpt = List(topicOpt, whitelistOpt).filter(options.has)
-    if (topicOrFilterOpt.size != 1)
-      CommandLineUtils.printUsageAndDie(parser, "Exactly one of 
whitelist/topic is required.")
+    val filterOpts = List(includeOpt, whitelistOpt).filter(options.has)
+    if (filterOpts.size == 2) {
+      CommandLineUtils.warn("--whitelist is DEPRECATED and ignored if 
--include specified.")

Review comment:
       I see. In this case, I would remove that warning and ignore `whitelist` 
if `include` is provided as you did in the first place to stay consistent with 
the other tools.
   
   My only ask was to extend the error message to mention `--whitelist` if used 
like you did here:
   ```
   CommandLineUtils.printUsageAndDie(parser, s"Exactly one of --include/--topic 
is required. " +
           s"${if (options.has(whitelistOpt)) "--whitelist is DEPRECATED use 
--include instead."}")
   ```




-- 
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: jira-unsubscr...@kafka.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to