@param \Spryker\Install\Stage\Section\Command\CommandInterface $command
@param int $exitCode
@param string|null $store

@return void
160239
public function endCommand(CommandInterface $command, $exitCode, $store = null)
    {
        if ($this->output->isVeryVerbose()) {
            $this->newLine();
        }

        if ($this->output->isVerbose()) {
            $this->writeln($this->getVerboseCommandEndMessage($command, $exitCode));
            $this->newLine();

            return;
        }

        $this->endCommandOutputIfNormalOutput($command, $store);
    }
67622
public void executeCommand(String command, Integer exitStatus, String envVar) throws Exception {
        if (exitStatus == null) {
            exitStatus = 0;
        }

        command = "set -o pipefail && alias grep='grep --color=never' && " + command;
        getRemoteSSHConnection().runCommand(command);
        setCommandResult(getRemoteSSHConnection().getResult());
        setCommandExitStatus(getRemoteSSHConnection().getExitStatus());
        runCommandLoggerAndEnvVar(exitStatus, envVar, Boolean.FALSE);

        Assertions.assertThat(getRemoteSSHConnection().getExitStatus()).isEqualTo(exitStatus);
    }
339054
public function command($command, $method) {

        self::$commands[] = $command;
        self::$callbacks[$command] = $method;
    }
1298754
public void execute() throws BuildException {
    if (null == cmd)
      throw new BuildException("Missing command (cmd) argument");
    argv.add(0, cmd);

    if (null == confloader) {
      setConf(getProject().getProperty("hadoop.conf.dir"));
    }

    int exit_code = 0;
    try {
      pushContext();

      Configuration conf = new Configuration();
      conf.setClassLoader(confloader);
      exit_code = ToolRunner.run(conf, shell,
          argv.toArray(new String[argv.size()]));
      exit_code = postCmd(exit_code);

      if (0 > exit_code) {
        StringBuilder msg = new StringBuilder();
        for (String s : argv)
          msg.append(s + " ");
        msg.append("failed: " + exit_code);
        throw new Exception(msg.toString());
      }
    } catch (Exception e) {
      if (failonerror)
          throw new BuildException(e);
    } finally {
      popContext();
    }
  }
638390
public void execute() throws MojoExecutionException, MojoFailureException {
        try {
            final List<String> command = createCommand();
            checkWorkingDirectory();
            final int status = execute(command);
            if (failOnAnsibleError && status != 0){
                throw new MojoFailureException("Non-zero exit status returned");
            }
        } catch (IOException e) {
            throw new MojoExecutionException("Unable to run playbook", e);
        } catch (InterruptedException e) {
            throw new MojoExecutionException("Run interrupted", e);
        }
    }
1120516
protected function executeCommand(Command $command, array $arguments, OutputInterface $output)
    {
        $output = clone $output;
        if ($output->getVerbosity() >= OutputInterface::VERBOSITY_VERBOSE) {
            $output->setVerbosity($output->getVerbosity());
        } else {
            $output->setVerbosity(OutputInterface::VERBOSITY_QUIET);
        }

        return $command->run(new ArrayInput($arguments), $output);
    }
1303284
public function createExecutableFromCommand(
        CommandInterface $command,
        ConfigurationInterface $configuration
    ): ExecutableInterface {
        return $this->createCommandLineExecutable($command, $configuration);
    }
209409
public function execute(array $config, $catchException = true, $autoExit = true)
    {
        $application = new Application();

        $application->setCatchExceptions($catchException);
        $application->setAutoExit($autoExit);

        foreach ($config as $command) {
            if (!class_exists($command)) {
                print_r(Command::red("Command Not Found: [{$command}]\n"));
            } else {
                $application->add(new $command);
            }
        }

        $application->run();
    }
776095
public function runCommand(Command $command, InputInterface $input, OutputInterface $output) {
    return $this->doRunCommand($command, $input, $output);
  }
266421
protected function runCommand(CommandInterface $command, ConfigurationInterface $configuration)
    {
        $executable = $this->executableFactory->createExecutableFromCommand($command, $configuration);

        if (!$command->isStoreAware()) {
            $this->executeExecutable($executable, $command, $configuration);

            return;
        }

        foreach ($this->getExecutableStoresForCommand($command, $configuration) as $store) {
            $this->environmentHelper->putEnv('APPLICATION_STORE', $store);
            $this->executeExecutable($executable, $command, $configuration, $store);
            $this->environmentHelper->unsetEnv('APPLICATION_STORE');
        }
    }
1041572
public function exec($args = [], $returnExitCode = false)
    {
        $command = $this->prepareCommand($args);
        Yii::info("& $command");
        exec($command, $array, $exitcode);

        return $returnExitCode ? $exitcode : $array;
    }
880514
private void addCommandPolling(final CommandImpl command) throws DevFailed {
        if (MANAGER == null) {
            startCache();
        }
        removeCommandPolling(command);
        final CommandCache cache = new CommandCache(MANAGER, command, deviceName, deviceLock, aroundInvoke);
        if (command.getPollingPeriod() == 0) {
            extTrigCommandCacheMap.put(command, cache);
        } else {
            commandCacheMap.put(command, cache);
        }
        updatePoolConf();
    }
122566
protected function execute(InputInterface $input, OutputInterface $output)
    {
        $command = sprintf(
            'exec -i %s %s',
            $input->getArgument('container'),
            $input->getArgument('execcmd')
        );

        $response = $this->getFacade()->runDocker($command);

        if ($output->isVerbose()) {
            $output->writeln($response);
        }
    }
1342093
protected function execute(InputInterface $input, OutputInterface $output)
    {
        $gen = new CodeGenerator(
            Database::getConnection(),
            array('default' => 'PHPCI'),
            array('default' => PHPCI_DIR),
            false
        );

        $gen->generateModels();
        $gen->generateStores();
    }
482487
public function setExitCode($exitCode)
    {
        $this->exitCode = (int) $exitCode;

        $r = new \ReflectionProperty($this->error, 'code');
        $r->setAccessible(true);
        $r->setValue($this->error, $this->exitCode);
    }
365089
public function startCommand(CommandInterface $command, $store = null)
    {
        $this->timer->start($command);
        $message = $this->getStartCommandMessage($command, $store);
        if ($this->output->getVerbosity() === static::VERBOSITY_NORMAL) {
            $message .= sprintf(' <fg=magenta>(In progress...)</>');
        }

        if ($this->output->isVerbose()) {
            $this->writeln($message);
            $this->writeln(str_repeat('-', $this->lineLength));
            $this->newLine();

            return;
        }

        $this->writeln($message);
    }
1154055
private function runCommand($arguments, ConnectionInterface $connection)
    {
        try {

            $commandClass = array_shift($arguments);

            if (null !== $this->getLogger()) {
                $this->log(
                    'Command from ' . $connection->getRemoteAddress() .
                    ": [$commandClass] " .
                    join(', ', array_map('json_encode', $arguments))
                );
            }


            if (isset($this->commands[$commandClass])) {
                $command = $this->commands[$commandClass];
            } else {

                if (!class_exists($commandClass)) {
                    throw new \RuntimeException("Command class `$commandClass` does not found.");
                }

                $command = new $commandClass($this);

                if (!$command instanceof Command\CommandInterface) {
                    throw new \RuntimeException("Every command must implement Command\\CommandInterface.");
                }

                $this->commands[$commandClass] = $command;
            }

            $result = $command->run($arguments, $connection);
            $result = [self::RESULT, $result];

        } catch (\Exception $e) {

            $result = [self::EXCEPTION, get_class($e), $e->getMessage()];
            $this->log('Exception: ' . $e->getMessage());

        }

        $connection->write(json_encode($result) . self::END_OF_RESULT);
    }