Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: added code changes

...

To provide a consistent user experience, it would be nice to add a '--help' option to all Kafka commands.

Public Interfaces

 Add a  '--help' option to all Kafka commands that provides information about their usage.

Proposed Changes

Parsing logic of the Kafka commands shall be modified to handle the "--help" option.

...

Code modifications

...

(git diff)


Code Block
titlecore/src/main/scala/kafka/admin/BrokerApiVersionsCommand.scala
@@ -72,7 +72,13 @@ object BrokerApiVersionsCommand {
                                    .withRequiredArg
                                    .describedAs("server(s) to use for bootstrapping")
                                    .ofType(classOf[String])
+    val helpOpt = parser.accepts("help", "Print usage information.")
+
     val options = parser.parse(args : _*)
+
+    if (options.has(helpOpt))
+      CommandLineUtils.printUsageAndDie(parser, "Usage:")
+
     checkArgs()
 
     def checkArgs() {

...