ijuma commented on a change in pull request #10471:
URL: https://github.com/apache/kafka/pull/10471#discussion_r635203967



##########
File path: 
core/src/test/scala/unit/kafka/admin/ReassignPartitionsCommandArgsTest.scala
##########
@@ -230,15 +214,9 @@ class ReassignPartitionsCommandArgsTest {
   }
 
   @Test
-  def testInvalidCommandConfigArgumentForLegacyGenerate(): Unit = {
-    val args = Array(
-      "--zookeeper", "localhost:1234",
-      "--generate",
-      "--broker-list", "101,102",
-      "--topics-to-move-json-file", "myfile.json",
-      "--command-config", "/tmp/command-config.properties"
-    )
-    shouldFailWith("You must specify --bootstrap-server when using 
\"[command-config]\"", args)
+  def shouldPrintHelpTextIfHelpArg(): Unit = {
+    val args: Array[String]= Array("--help")
+    shouldFailWith(ReassignPartitionsCommand.helpText, args)

Review comment:
       Should this actually fail? It seems that it should succeed, right?

##########
File path: core/src/main/scala/kafka/admin/ReassignPartitionsCommand.scala
##########
@@ -194,33 +192,18 @@ object ReassignPartitionsCommand extends Logging {
 
   def main(args: Array[String]): Unit = {
     val opts = validateAndParseArgs(args)
-    var toClose: Option[AutoCloseable] = None
     var failed = true
 
+    val props = if (opts.options.has(opts.commandConfigOpt))
+      Utils.loadProps(opts.options.valueOf(opts.commandConfigOpt))

Review comment:
       Why is props setup safe? It could fail to load the fail, etc.




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