code: protected static void main(String[] args, CliTool command) {
      JCommander jc = new JCommander(command);
      jc.addConverterFactory(new CustomParameterConverters());
      jc.setProgramName(command.getClass().getAnnotation(Parameters.class).commandNames()[0]);
  
      ExitStatus exitStatus = ExitStatus.SUCCESS;
      try {
        jc.parse(args);
        if (command.help) {
          helpDisplayCommandOptions(System.err, jc);
        } else {
          exitStatus = command.call();
        }
      } catch (ExitStatusException e) {
        System.err.println(e.getMessage());
        if (e.getCause() != null) {
          e.getCause().printStackTrace(System.err);
        }
        exitStatus = e.exitStatus;
      } catch (MissingCommandException e) {
        System.err.println("Invalid argument: " + e);
        System.err.println();
        helpDisplayCommandOptions(System.err, jc);
        exitStatus = ExitStatus.ERROR_INVALID_ARGUMENTS;
      } catch (ParameterException e) {
        System.err.println("Invalid argument: " + e.getMessage());
        System.err.println();
  
        if (jc.getParsedCommand() == null) {
          helpDisplayCommandOptions(System.err, jc);
        } else {
          helpDisplayCommandOptions(System.err, jc.getParsedCommand(), jc);
        }
        exitStatus = ExitStatus.ERROR_INVALID_ARGUMENTS;
      } catch (Throwable t) {
        System.err.println("An unhandled exception occurred. Stack trace below.");
        t.printStackTrace(System.err);
        exitStatus = ExitStatus.ERROR_OTHER;
      }
  
      if (command.callSystemExit) {
        System.exit(exitStatus.code);
      }
    }
docs: Parse and execute a single command.
  
  @param args Command line arguments (command and options).
  @param command The command to execute.