MINOR: Add --help to DumpLogSegments
Author: Tom Bentley
Reviewers: Ismael Juma
Closes from tombentley/help
@@ -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) ||
