Run the tool's lifecycle given the input arguments.

@param args the cli arg vector

@throws CLIToolException if an error occurs
977454
public void run(final String[] args) throws CLIToolException {
        PropertyConfigurator.configure(Constants.getLog4jPropertiesFile().getAbsolutePath());
        CommandLine cli = parseArgs(args);
        validateOptions(cli,args);
        go();
    }
139546
public boolean run(String... arguments) throws Exception {
        try {
            if (isFlag(HELP, arguments)) {
                parser.printHelp(stdOut);
            } else if (isFlag(VERSION, arguments)) {
                parser.printVersion(stdOut);
            } else {
                final Namespace namespace = parser.parseArgs(arguments);
                final Command command = requireNonNull(commands.get(namespace.getString(COMMAND_NAME_ATTR)),
                    "Command is not found");
                try {
                    command.run(bootstrap, namespace);
                } catch (Throwable e) {
                    // The command failed to run, and the command knows
                    // best how to cleanup / debug exception
                    command.onError(this, namespace, e);
                    return false;
                }
            }
            return true;
        } catch (HelpScreenException ignored) {
            // This exception is triggered when the user passes in a help flag.
            // Return true to signal that the process executed normally.
            return true;
        } catch (ArgumentParserException e) {
            stdErr.println(e.getMessage());
            e.getParser().printHelp(stdErr);
            return false;
        }
    }
823842
@SuppressWarnings("PMD")
  public static void main(String[] args) {
    if (args.length < 2) {
      System.out.println("Usage: perf <registry> <test>");
      System.exit(1);
    }

    Registry registry = run(args[0], args[1]);

    GraphLayout igraph = GraphLayout.parseInstance(registry);
    System.out.println(igraph.toFootprint());
  }
42799
public static void main(final String[] args)
      throws IOException, JDOMException {
    CLI cmdLine = new CLI();
    cmdLine.parseCLI(args);
  }
267071
public static void runCLIApplication(Class<?> cls, String[] args) {
    SerializedParameterization params = new SerializedParameterization(args);
    Flag helpF = new Flag(Parameterizer.HELP_ID);
    params.grab(helpF);
    Flag helpLongF = new Flag(Parameterizer.HELP_LONG_ID);
    params.grab(helpLongF);
    try {
      ClassParameter<Object> descriptionP = new ClassParameter<>(Parameterizer.DESCRIPTION_ID, Object.class, true);
      params.grab(descriptionP);
      if(descriptionP.isDefined()) {
        params.clearErrors();
        printDescription(descriptionP.getValue());
        System.exit(1);
      }
      // Parse debug parameter
      StringParameter debugP = new StringParameter(Parameterizer.DEBUG_ID).setOptional(true);
      params.grab(debugP);
      if(debugP.isDefined()) {
        Parameterizer.parseDebugParameter(debugP);
      }
      // Fail silently on errors.
      if(params.getErrors().size() > 0) {
        params.logAndClearReportedErrors();
        System.exit(1);
      }
    }
    catch(Exception e) {
      printErrorMessage(e);
      System.exit(1);
    }
    try {
      TrackParameters config = new TrackParameters(params);
      Flag verboseF = new Flag(Parameterizer.VERBOSE_ID);
      if(config.grab(verboseF) && verboseF.isTrue()) {
        // Extra verbosity by repeating the flag:
        Flag verbose2F = new Flag(Parameterizer.VERBOSE_ID);
        LoggingConfiguration.setVerbose((config.grab(verbose2F) && verbose2F.isTrue()) ? Level.VERYVERBOSE : Level.VERBOSE);
      }
      AbstractApplication task = ClassGenericsUtil.tryInstantiate(AbstractApplication.class, cls, config);

      if((helpF.isDefined() && helpF.getValue()) || (helpLongF.isDefined() && helpLongF.getValue())) {
        LoggingConfiguration.setVerbose(Level.VERBOSE);
        LOG.verbose(usage(config.getAllParameters()));
        System.exit(1);
      }
      if(params.getErrors().size() > 0) {
        LoggingConfiguration.setVerbose(Level.VERBOSE);
        LOG.verbose("ERROR: The following configuration errors prevented execution:");
        for(ParameterException e : params.getErrors()) {
          LOG.verbose(e.getMessage() + "\n");
        }
        params.logUnusedParameters();
        LOG.verbose("Stopping execution because of configuration errors above.");
        System.exit(1);
      }
      params.logUnusedParameters();
      task.run();
    }
    catch(Exception e) {
      printErrorMessage(e);
    }
  }
131779
public static void main(String[] args) {
    ExtensionsShell extensionShell =
        new ExtensionsShell(ServerConfiguration.global());
    System.exit(extensionShell.run(args));
  }
744749
public void run(String[] args) {
        String context = args.length > 0 ? args[0] : "";
        String action = args.length > 1 ? args[1] : "";
        String option = args.length > 2 ? args[2] : "";

        switch (context) {
            case "server":
                server(action, option);
                break;
            case "version":
                version();
                break;
            default:
                help();
        }
    }
1200644
public void start(String[] args) {
		this.args = args;
		try {
			this.run(args);
		}
		catch (Exception e) {
			e.printStackTrace();
		}
		this.exit();
	}
316853
public static void main(String... args) {
        CommandLineRunner runner = new CommandLineRunner();

        try {
            runner.run(args);
        } catch (Exception t) {
            System.err.println(t.getMessage());
            System.err.println("Try '--help' for more information.");

            t.printStackTrace(System.err);

            System.exit(1);
        }

        System.exit(0);
    }
92048
public static void main(String[] args) {

		ListRepo listRepo = new ListRepo();
		try {
			listRepo.run(args);
		} catch (Exception e) {
			e.printStackTrace();
		}
	}
1047290
private void run(String[] arguments) throws Exception {

        if(isHelpRequested(arguments)) {
            usage();
        }

        validateArguments(arguments);

        checkTemporaryDirectory(arguments);


        addShutdownHook();

        File war = getWarLocation();

        File tempDirectory = createTempDirectory(war.getName(), getPort(arguments));

        cl = createClassLoader(war, tempDirectory);

        Thread.currentThread().setContextClassLoader(cl);

        startJettyConsole(cl, arguments, tempDirectory);
    }
481210
public void execute(final String[] args) {
        log.info("Generation started");
        try {
            Options options = createOptions();
            if (collectOptions(options, args)) {
                setDefaults();
                if (input.isDirectory()) {
                    for (File cobolFile : FileUtils
                            .listFiles(input, null, true)) {
                        generate(configProps, cobolFile, inputEncoding, output,
                                packagePrefix, xsltFileName);
                    }
                } else {
                    generate(configProps, input, inputEncoding, output,
                            packagePrefix, xsltFileName);
                }
            }
        } catch (Exception e) {
            log.error("Generation failed", e);
        } finally {
            log.info("Generation ended");
        }
    }
140395
protected void go() throws CLIToolOptionsException {
        if (null == action) {
            throw new CLIToolOptionsException("Command expected. Choose one of: " + Arrays.asList(Actions.values()));
        }
        try {
            switch (action) {
                case list:
                    listAction();
                    break;
                case test:
                    testAction();
                    break;
                case create:
                    createAction();
                    break;
                case validate:
                    validateAction();
                    break;
                default:
                    throw new CLIToolOptionsException("Unrecognized action: " + action);
            }
        } catch (IOException | PoliciesParseException e) {
            throw new CLIToolOptionsException(e);
        }
    }
116910
public static void main(String[] args) {
    EventQueue.invokeLater(new Runnable() {
      @Override
      public void run() {
        try {
          ScannerReportViewerApp window = new ScannerReportViewerApp();
          window.frame.setVisible(true);

          window.loadReport();
        } catch (Exception e) {
          e.printStackTrace();
        }
      }

    });
  }
703402
public static void main(String[] args) {
		Test instance = JKFactory.instance(Test.class);
		System.out.println(instance.hello());
		System.out.println(instance.hello());
		System.out.println(instance.hello());
		System.out.println(instance.hello());

	}
408302
protected static void main(String[] args, CliTool... commands) {
    if (commands.length == 1) {
      main(args, commands[0]);
    } else {
      JCommander jc = new JCommander();
      for (CliTool command : commands) {
        jc.addCommand(command);
      }
      jc.addConverterFactory(new CustomParameterConverters());
      jc.setProgramName("");
  
      ExitStatus exitStatus = ExitStatus.SUCCESS;
      try {
        jc.parse(args);

        final String commandName = jc.getParsedCommand();
        if (commandName == null) {
          helpDisplayCommandOptions(System.err, jc);
        } else {
          List<Object> objects = jc.getCommands().get(commandName).getObjects();
          if (objects.size() != 1) {
            throw new RuntimeException();
          }

          CliTool command = CliTool.class.cast(objects.get(0));
          exitStatus = command.call();
          if (command.callSystemExit) {
            System.exit(exitStatus.code);
          }
        }
      } 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;
      }
    }
  }
945508
public static void main(final String[] args) {
        SwingUtilities.invokeLater(new Runnable() {
            public void run() {
                Utils4Swing.initSystemLookAndFeel();
                Utils4Swing.createShowAndPosition("Test Progress Dialog",
                        new FileCopyProgressPanel(), true, new ScreenCenterPositioner());
            }
        });
    }