Executes the list action.

@param args Command line arguments for the list action.
174353
protected void list(String[] args) throws Exception {
		LOG.info("Running 'list' command.");

		final Options commandOptions = CliFrontendParser.getListCommandOptions();

		final Options commandLineOptions = CliFrontendParser.mergeOptions(commandOptions, customCommandLineOptions);

		final CommandLine commandLine = CliFrontendParser.parse(commandLineOptions, args, false);

		ListOptions listOptions = new ListOptions(commandLine);

		// evaluate help flag
		if (listOptions.isPrintHelp()) {
			CliFrontendParser.printHelpForList(customCommandLines);
			return;
		}

		final boolean showRunning;
		final boolean showScheduled;
		final boolean showAll;

		// print running and scheduled jobs if not option supplied
		if (!listOptions.showRunning() && !listOptions.showScheduled() && !listOptions.showAll()) {
			showRunning = true;
			showScheduled = true;
			showAll = false;
		} else {
			showRunning = listOptions.showRunning();
			showScheduled = listOptions.showScheduled();
			showAll = listOptions.showAll();
		}

		final CustomCommandLine<?> activeCommandLine = getActiveCustomCommandLine(commandLine);

		runClusterAction(
			activeCommandLine,
			commandLine,
			clusterClient -> listJobs(clusterClient, showRunning, showScheduled, showAll));

	}
86867
public static void main(String[] args)
	{
		CommandLineRemoteRunner runner = new CommandLineRemoteRunner();
		LoggingMonitor monitor = new LoggingMonitor(System.out, System.err);
		runner.setMonitor(monitor);

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

			if (e.getCause() != null)
			{
				System.err.println("Caused by:");
				e.getCause().printStackTrace(System.err);
			}

			System.exit(1);
		}
		catch (Throwable t)
		{
			monitor.exceptionOccured(t);
			System.exit(1);
		}
	}
390030
public static void main(String[] args) {
        try {
            ParsedCommandLine pcl = new ParsedCommandLine(args);
            Callable<String> command = pcl.getCommand();
            if (command == null) {
                System.out.println(pcl.getHelpText());
            } else {
                System.out.println(command.call());
            }
        } catch (Exception ex) {
            System.err.println("ERROR: " + ex.getMessage());
        }
    }
219927
public static void main(String[] args) {

    try {
      final CrawlToFile crawl = new CrawlToFile(args);
      crawl.crawl();

    } catch (ParseException e) {
      System.err.print(e.getMessage());
    } catch (IllegalArgumentException e) {
      System.err.println(e.getMessage());
    }

  }
977454
public void run(final String[] args) throws CLIToolException {
        PropertyConfigurator.configure(Constants.getLog4jPropertiesFile().getAbsolutePath());
        CommandLine cli = parseArgs(args);
        validateOptions(cli,args);
        go();
    }
645085
public static void executeHelp(String[] args, PrintStream stream) throws IOException {
        String subCmd = (args.length > 0) ? args[0] : "";
        if(subCmd.equals("list")) {
            SubCommandAsyncJobList.printHelp(stream);
        } else if(subCmd.equals("stop")) {
            SubCommandAsyncJobStop.printHelp(stream);
        } else {
            printHelp(stream);
        }
    }
784158
public void command(String... args)
    {
        try
        {
            setArgs(args);
        }
        catch (CmdArgsException ex)
        {
            ex.printStackTrace();
            Logger logger = Logger.getLogger(CmdArgs.class.getName());
            logger.log(Level.SEVERE, Arrays.toString(args));
            logger.log(Level.SEVERE, ex.getMessage(), ex);
            logger.log(Level.SEVERE, ex.usage());
            System.exit(-1);
        }
    }
554422
@Override
	public void run(ApplicationArguments args) throws Exception {
		List<File> scriptsToRun = args.getNonOptionArgs().stream()
				.filter(s -> s.startsWith("@"))
				.map(s -> new File(s.substring(1)))
				.collect(Collectors.toList());

		boolean batchEnabled = environment.getProperty(SPRING_SHELL_SCRIPT_ENABLED, boolean.class, true);

		if (!scriptsToRun.isEmpty() && batchEnabled) {
			InteractiveShellApplicationRunner.disable(environment);
			for (File file : scriptsToRun) {
				try (Reader reader = new FileReader(file);
						FileInputProvider inputProvider = new FileInputProvider(reader, parser)) {
					shell.run(inputProvider);
				}
			}
		}
	}
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);
    }
1185216
public static void executeCommand(String[] args) throws Exception {
        String subCmd = (args.length > 0) ? args[0] : "";
        args = CoordinatorAdminUtils.copyArrayCutFirst(args);
        if(subCmd.equals("get")) {
            SubCommandGet.executeCommand(args);
        } else if(subCmd.equals("put")) {
            SubCommandPut.executeCommand(args);
        } else if(subCmd.equals("delete")) {
            SubCommandDelete.executeCommand(args);
        } else {
            args = CoordinatorAdminUtils.copyArrayAddFirst(args, subCmd);
            executeHelp(args, System.out);
        }
    }
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;
        }
    }
668559
public static synchronized void run(String[] args, String... extraArgs) {
		AppStarter.startUp(args, extraArgs);

		// no implicit classpath scanning here
		boot();

		// finish initialization and start the application
		onAppReady();

		boot();
	}
386301
public void setArgs(java.util.Collection<String> args) {
        if (args == null) {
            this.args = null;
            return;
        }

        this.args = new com.amazonaws.internal.SdkInternalList<String>(args);
    }
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);
    }
372734
void run(List<String> arguments, @Nullable Path workingDirectory)
      throws ProcessHandlerException, CloudSdkNotFoundException, CloudSdkOutOfDateException,
          CloudSdkVersionFileException, IOException {

    sdk.validateCloudSdk();

    List<String> command = new ArrayList<>();
    command.add(sdk.getGCloudPath().toAbsolutePath().toString());

    command.addAll(arguments);
    if (outputFormat != null) {
      command.addAll(GcloudArgs.get("format", outputFormat));
    }

    if (credentialFile != null) {
      command.addAll(GcloudArgs.get("credential-file-override", credentialFile));
    }

    logger.info("submitting command: " + Joiner.on(" ").join(command));

    ProcessBuilder processBuilder = processBuilderFactory.newProcessBuilder();
    processBuilder.command(command);
    if (workingDirectory != null) {
      processBuilder.directory(workingDirectory.toFile());
    }
    processBuilder.environment().putAll(getGcloudCommandEnvironment());
    Process process = processBuilder.start();
    processHandler.handleProcess(process);
  }
268815
public static void executeCommand(String[] args) throws IOException {

            OptionParser parser = getParser();

            // declare parameters
            String url = null;

            // parse command-line input
            OptionSet options = parser.parse(args);
            if(options.has(AdminParserUtils.OPT_HELP)) {
                printHelp(System.out);
                return;
            }

            // check required options and/or conflicting options
            AdminParserUtils.checkRequired(options, AdminParserUtils.OPT_URL);

            // load parameters
            url = (String) options.valueOf(AdminParserUtils.OPT_URL);

            // execute command
            AdminClient adminClient = AdminToolUtils.getAdminClient(url);

            doMetaCheckVersion(adminClient);
        }
275
public static void main(String[] args) {
    System.err.println(toString(new int[] { Integer.parseInt(args[0]) }));
  }