dongjinleekr commented on a change in pull request #10827: URL: https://github.com/apache/kafka/pull/10827#discussion_r655236164
########## File path: core/src/main/scala/kafka/tools/ReplicaVerificationTool.scala ########## @@ -73,53 +74,61 @@ object ReplicaVerificationTool extends Logging { ReplicaVerificationTool.dateFormat.format(new Date(Time.SYSTEM.milliseconds)) } - def main(args: Array[String]): Unit = { - val parser = new OptionParser(false) - val brokerListOpt = parser.accepts("broker-list", "REQUIRED: The list of hostname and port of the server to connect to.") - .withRequiredArg - .describedAs("hostname:port,...,hostname:port") - .ofType(classOf[String]) - val fetchSizeOpt = parser.accepts("fetch-size", "The fetch size of each request.") - .withRequiredArg - .describedAs("bytes") - .ofType(classOf[java.lang.Integer]) - .defaultsTo(ConsumerConfig.DEFAULT_MAX_PARTITION_FETCH_BYTES) - val maxWaitMsOpt = parser.accepts("max-wait-ms", "The max amount of time each fetch request waits.") - .withRequiredArg - .describedAs("ms") - .ofType(classOf[java.lang.Integer]) - .defaultsTo(1000) + // Non-private for testing + sealed class ReplicaVerificationToolOptions(args: Array[String]) extends CommandDefaultOptions(args) { + private val brokerListOpt = parser.accepts("broker-list", "DEPRECATED, use --bootstrap-server instead; ignored if --bootstrap-server is specified. The list of hostname and port of the server to connect to.") + .withRequiredArg + .describedAs("HOST1:PORT1,...,HOST3:PORT3") + .ofType(classOf[String]) + private val bootstrapServerOpt = parser.accepts("bootstrap-server", "REQUIRED. The list of hostname and port of the server to connect to.") + .requiredUnless("broker-list") + .withRequiredArg + .describedAs("HOST1:PORT1,...,HOST3:PORT3") Review comment: `ConsoleConsumer`, `AclCommand`, `ConfigCommand` also do. :+1: -- 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