docs: public void run(String[] args) {
      // Add and parse options.
      OptionParser parser = new OptionParser();
      initializeCommonOptions(parser);
      initializeOptions(parser);
  
      String errorMessage = null;
      try {
        parsedOptions = parser.parse(args);
      } catch (OptionException e) {
        errorMessage = e.getMessage();
      }
  
      boolean printHelp = false;
      if (errorMessage != null) {
        // If an error occurs, the options don't parse.
        // Therefore, we must manually check if the help option was
        // given.
        for (int i = 0; i < args.length; i++) {
          if (args[i].equals("--help")) {
            printHelp = true;
          }
        }
      }
  
      if (errorMessage != null && !printHelp) {
        System.err.println(errorMessage);
        System.err.println("Try --help for more information about options.");
        System.exit(1);
      }
  
      if (printHelp || parsedOptions.has(helpOpt)) {
        // If a help option is given, print help then quit.
        try {
          parser.printHelpOn(System.err);
        } catch (IOException ioException) {
          throw new RuntimeException(ioException);
        }
        System.exit(0);
      }
  
      // Log any passed-in options.
      if (!parsedOptions.has(noPrintOptions)) {
        System.out.println("Command-line options:");
        for (OptionSpec<?> optionSpec : parsedOptions.specs()) {
          if (parsedOptions.hasArgument(optionSpec)) {
            System.out.println("--" + Iterables.getFirst(optionSpec.options(), "") + " "
                + Joiner.on(" ").join(parsedOptions.valuesOf(optionSpec)));
          } else {
            System.out.println("--" + Iterables.getFirst(optionSpec.options(), ""));
          }
        }
        System.out.println("");
      }
  
      // Run the program.
      long startTime = System.currentTimeMillis();
      processOptions(parsedOptions);
      run(parsedOptions);
      long endTime = System.currentTimeMillis();
  
      if (!parsedOptions.has(noPrintOptions)) {
        System.out.println("Total time elapsed: " + TimeUtils.durationToString(endTime - startTime));
      }
  
      System.exit(0);
    }