@Override
  public int run(final String[] args) throws IOException {
    // create options
    Options options = new Options();
    options.addOption("h", "help", false, "Output help message");
    options.addOption("f", "file", true, "File to print");

    final List<Path> files = new ArrayList<>();
    try {
      CommandLine cmd = new DefaultParser().parse(options, args);

      if (cmd.hasOption("f")) {
        files.add(new Path(cmd.getOptionValue("f")));
      }

      if (files.isEmpty() || cmd.hasOption("h")) {
        HelpFormatter formatter = new HelpFormatter();
        formatter.printHelp("ProcedureWALPrettyPrinter ", options, true);
        return (-1);
      }
    } catch (ParseException e) {
      LOG.error("Failed to parse commandLine arguments", e);
      HelpFormatter formatter = new HelpFormatter();
      formatter.printHelp("ProcedureWALPrettyPrinter ", options, true);
      return (-1);
    }
    // get configuration, file system, and process the given files
    for (Path file : files) {
      processFile(getConf(), file);
    }
    return (0);
  }
Pass one or more log file names and formatting options and it will dump out a text version of
the contents on <code>stdout</code>. Command line arguments Thrown upon file system errors etc.
hbase-procedure/src/main/java/org/apache/hadoop/hbase/procedure2/store/wal/ProcedureWALPrettyPrinter.java