You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kafka.apache.org by ij...@apache.org on 2017/06/16 11:32:39 UTC

kafka git commit: MINOR: Add --help to DumpLogSegments

Repository: kafka
Updated Branches:
  refs/heads/trunk 6f1d4c693 -> 6cd7f448a


MINOR: Add --help to DumpLogSegments

Author: Tom Bentley <tb...@redhat.com>

Reviewers: Ismael Juma <is...@juma.me.uk>

Closes #3351 from tombentley/help


Project: http://git-wip-us.apache.org/repos/asf/kafka/repo
Commit: http://git-wip-us.apache.org/repos/asf/kafka/commit/6cd7f448
Tree: http://git-wip-us.apache.org/repos/asf/kafka/tree/6cd7f448
Diff: http://git-wip-us.apache.org/repos/asf/kafka/diff/6cd7f448

Branch: refs/heads/trunk
Commit: 6cd7f448aa6cc9f8bde27ab46ab1db1048194066
Parents: 6f1d4c6
Author: Tom Bentley <tb...@redhat.com>
Authored: Fri Jun 16 12:32:33 2017 +0100
Committer: Ismael Juma <is...@juma.me.uk>
Committed: Fri Jun 16 12:32:33 2017 +0100

----------------------------------------------------------------------
 core/src/main/scala/kafka/tools/DumpLogSegments.scala | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/kafka/blob/6cd7f448/core/src/main/scala/kafka/tools/DumpLogSegments.scala
----------------------------------------------------------------------
diff --git a/core/src/main/scala/kafka/tools/DumpLogSegments.scala b/core/src/main/scala/kafka/tools/DumpLogSegments.scala
index 9179fec..7bec15f 100755
--- a/core/src/main/scala/kafka/tools/DumpLogSegments.scala
+++ b/core/src/main/scala/kafka/tools/DumpLogSegments.scala
@@ -66,11 +66,13 @@ object DumpLogSegments {
     val transactionLogOpt = parser.accepts("transaction-log-decoder", "if set, log data will be parsed as " +
       "transaction metadata from the __transaction_state topic.")
 
-    if(args.length == 0)
-      CommandLineUtils.printUsageAndDie(parser, "Parse a log file and dump its contents to the console, useful for debugging a seemingly corrupt log segment.")
+    val helpOpt = parser.accepts("help", "Print usage information.")
 
     val options = parser.parse(args : _*)
 
+    if(args.length == 0 || options.has(helpOpt))
+      CommandLineUtils.printUsageAndDie(parser, "Parse a log file and dump its contents to the console, useful for debugging a seemingly corrupt log segment.")
+
     CommandLineUtils.checkRequiredArgs(parser, options, filesOpt)
 
     val printDataLog = options.has(printOpt) ||