dengziming commented on a change in pull request #9769:
URL: https://github.com/apache/kafka/pull/9769#discussion_r556178594



##########
File path: core/src/main/scala/kafka/admin/TopicCommand.scala
##########
@@ -742,10 +760,16 @@ object TopicCommand extends Logging {
       if (has(bootstrapServerOpt) == has(zkConnectOpt))
         throw new IllegalArgumentException("Only one of --bootstrap-server or 
--zookeeper must be specified")
 
+      if (has(topicIdOpt) && has(zkConnectOpt)) {
+        throw new IllegalArgumentException("--topic-id can used only with 
--bootstrap-server")
+      }
+
       if (!has(bootstrapServerOpt))
         CommandLineUtils.checkRequiredArgs(parser, options, zkConnectOpt)
-      if(has(describeOpt) && has(ifExistsOpt))
-        CommandLineUtils.checkRequiredArgs(parser, options, topicOpt)

Review comment:
       Yes, when we use `--describe`, `--topic` is not mandatory. I add a 
`if(has(topicOpt) == has(topicIdOpt))` to ensure only one of `--topic` and 
`--topic-id` is used. 




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

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


Reply via email to