Browse Source

MINOR: Respect the default value of partition argument in SimpleConsumerShell

The `partition` argument is not marked as required, and has a default of `0`, according to the tool's help message. However, if `partition` is not provided the command returns with `Missing required argument "[partition]"`. This patch is to fix the required arguments of the tool by removing `partition` from them.

Author: Vahid Hashemian <vahidhashemian@us.ibm.com>

Reviewers: Ewen Cheslack-Postava <ewen@confluent.io>

Closes #1495 from vahidhashemian/minor/simple_consumer_shell_update_required_args
pull/1460/merge
Vahid Hashemian 9 years ago committed by Ewen Cheslack-Postava
parent
commit
b058fcf5ec
  1. 2
      core/src/main/scala/kafka/tools/SimpleConsumerShell.scala

2
core/src/main/scala/kafka/tools/SimpleConsumerShell.scala

@ -101,7 +101,7 @@ object SimpleConsumerShell extends Logging { @@ -101,7 +101,7 @@ object SimpleConsumerShell extends Logging {
CommandLineUtils.printUsageAndDie(parser, "A low-level tool for fetching data directly from a particular replica.")
val options = parser.parse(args : _*)
CommandLineUtils.checkRequiredArgs(parser, options, brokerListOpt, topicOpt, partitionIdOpt)
CommandLineUtils.checkRequiredArgs(parser, options, brokerListOpt, topicOpt)
val topic = options.valueOf(topicOpt)
val partitionId = options.valueOf(partitionIdOpt).intValue()

Loading…
Cancel
Save