showuon commented on a change in pull request #10457:
URL: https://github.com/apache/kafka/pull/10457#discussion_r606159844



##########
File path: core/src/main/scala/kafka/admin/TopicCommand.scala
##########
@@ -739,16 +573,14 @@ object TopicCommand extends Logging {
         CommandLineUtils.printUsageAndDie(parser, "Command must include 
exactly one action: --list, --describe, --create, --alter or --delete")
 
       // check required args
-      if (has(bootstrapServerOpt) == has(zkConnectOpt))
-        throw new IllegalArgumentException("Only one of --bootstrap-server or 
--zookeeper must be specified")
-
       if (!has(bootstrapServerOpt))
-        CommandLineUtils.checkRequiredArgs(parser, options, zkConnectOpt)
+        throw new IllegalArgumentException("--bootstrap-server must be 
specified")

Review comment:
       Good suggestion! Updated

##########
File path: core/src/main/scala/kafka/admin/TopicCommand.scala
##########
@@ -739,16 +573,14 @@ object TopicCommand extends Logging {
         CommandLineUtils.printUsageAndDie(parser, "Command must include 
exactly one action: --list, --describe, --create, --alter or --delete")
 
       // check required args
-      if (has(bootstrapServerOpt) == has(zkConnectOpt))
-        throw new IllegalArgumentException("Only one of --bootstrap-server or 
--zookeeper must be specified")
-
       if (!has(bootstrapServerOpt))
-        CommandLineUtils.checkRequiredArgs(parser, options, zkConnectOpt)
+        throw new IllegalArgumentException("--bootstrap-server must be 
specified")
+
       if(has(describeOpt) && has(ifExistsOpt))
         CommandLineUtils.checkRequiredArgs(parser, options, topicOpt)
       if (!has(listOpt) && !has(describeOpt))
         CommandLineUtils.checkRequiredArgs(parser, options, topicOpt)
-      if (has(createOpt) && !has(replicaAssignmentOpt) && has(zkConnectOpt))
+      if (has(createOpt) && !has(replicaAssignmentOpt))
         CommandLineUtils.checkRequiredArgs(parser, options, partitionsOpt, 
replicationFactorOpt)
       if (has(bootstrapServerOpt) && has(alterOpt)) {

Review comment:
       You're right.




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