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



##########
File path: core/src/main/scala/kafka/tools/ConsoleConsumer.scala
##########
@@ -315,11 +321,18 @@ 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.")
     topicArg = options.valueOf(topicOpt)
-    whitelistArg = options.valueOf(whitelistOpt)
+    includedTopicsArg = if (options.has(includeOpt))
+      options.valueOf(includeOpt)
+    else
+      options.valueOf(whitelistOpt)
+
+    val noTopicOrFilterSpecified = topicArg == null && includedTopicsArg == 
null
+    val bothTopicAndFilterSpecified = topicArg != null && includedTopicsArg != 
null
+
+    if (noTopicOrFilterSpecified || bothTopicAndFilterSpecified)

Review comment:
       I don't have a strong preference, feel free to use whichever approach 
seems more readable to you




-- 
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