Run command
@param string $command either `up` or `down`
497658
protected function run($command)
    {
        if (array_key_exists('migrationPath', $this->config)) {
            $migrationPaths = $this->config['migrationPath'];

            if (is_string($migrationPaths)) {
                $migrationPaths = [$migrationPaths];
            }

            $this->runMigrationByPaths($migrationPaths, $command);
        } elseif (array_key_exists('migrationNamespaces', $this->config)) {
            $migrationNamespaces = $this->config['migrationNamespaces'];

            if (is_string($migrationNamespaces)) {
                $migrationNamespaces = [$migrationNamespaces];
            }

            $this->runMigrationByNamespaces($migrationNamespaces, $command);
        } else {
            $this->runMigrationByApplication($command);
        }
    }
1295064
public function command($command)
    {
        if (! $command instanceof Command) {
            $command = $this[$command];
        }

        $this['console']->add($command);
    }
857822
public function runComposerCommand(string $command, bool $failNonZero = true)
    {
        $this->debug("> composer $command");
        $this->cli->runShellCommand("composer $command", $failNonZero);
    }
693419
public function execute(\Sigbits\RoombaLib\SCI\Command $command)
    {
        $this->connection->write($command);
    }
1130097
public function addCommand($command)
    {
        if (is_string($command)) {
            $command = $this->app->make($command);
        }

        if ($command instanceof Command) {
            $command->setLaravel($this->app);
        }

        $this->console->add($command);
    }
633707
public function run($args)
  {
    $this->args = $args;
    $command = $this->args['commands'][1];
    $path = $this->root.DIRECTORY_SEPARATOR.'cmd'.DIRECTORY_SEPARATOR.$command;
    if(!is_dir($path)){
      print $command.' doesn\'t appear to be a valid command!';
      return;
    }
    $file = $path.DIRECTORY_SEPARATOR.$this->helpFile;
    if(stream_resolve_include_path($file)){
       print file_get_contents($file);
    }
  }
571361
def run_command(command, args):
    
    for category, commands in iteritems(command_categories):
        for existing_command in commands:
            if existing_command.match(command):
                existing_command.run(args)
781732
protected function validateCommand($command) {
        if ( ! is_string($command) && ! is_object($command)) {
            throw new InvalidCommandException(s(
                'Command must be either a class name or an instance, "%s" given.',
                get_type($command)
            ));
        }

        if (is_string($command) && ! class_exists($command)) {
            throw new InvalidCommandException(s(
                'Command "%s" does not exist.',
                $command
            ));
        }

        if ( ! method_exists($command, 'setup') || ! method_exists($command, 'run')) {
            throw new InvalidCommandException(s(
                'Command "%s" must implement methods "setup" and "run".',
                get_type($command)
            ));
        }
    }
1359322
public function enable(Command $command)
    {
        $command->call('down');

        foreach ($this->scripts as $script) {
            try {
                $this->app->make($script)->fire($command);
            } catch (\Exception $e) {
                $command->error($e->getMessage());

                return false;
            }
        }

        $command->call('up');

        return true;
    }
16960
private function runGitCommand($command)
    {
        $path = dirname($this->file);
        $process = new Process($command, $path);

        if (0 === $process->run()) {
            return trim($process->getOutput());
        }

        throw new RuntimeException(
            sprintf(
                'The tag or commit hash could not be retrieved from "%s": %s',
                $path,
                $process->getErrorOutput()
            )
        );
    }
1293272
protected function runCommand($command, $description) {
        $call = $this->output->isVerbose() ? 'call' : 'callSilent';
        $write = $this->output->isVerbose() ? 'writeln' : 'write';

        $this->output->{$write}('<comment>' . $description . '...</comment> ');
        $this->{$call}($command);
        $this->output->{$write}('Done!');

        $this->line('');
    }
828709
public function runCommand($command, array $options = [])
    {
        if (!is_array($command) && !is_object($command)) {
            throw new InvalidArgumentException(
                sprintf(
                    '$command must be an array or an object, %s given.',
                    \Tequila\MongoDB\getType($command)
                )
            );
        }

        $readPreference = isset($options['readPreference'])
            ? $options['readPreference']
            : $this->readPreference;

        if (!$readPreference instanceof ReadPreference) {
            throw new InvalidArgumentException(
                sprintf(
                    'Option "readPreference" is expected to be an instance of %s, %s given.',
                    ReadPreference::class,
                    \Tequila\MongoDB\getType($readPreference)
                )
            );
        }

        if (!$command instanceof \MongoDB\Driver\Command) {
            $command = new \MongoDB\Driver\Command($command);
        }
        $server = $this->manager->selectServer($readPreference);
        $cursor = $server->executeCommand($this->databaseName, $command);

        return new CommandCursor($cursor);
    }
91747
public function fire(Command $command)
    {
        if ($command->option('verbose')) {
            $command->blockMessage('Migrations', 'Starting the module migrations ...', 'comment');
        }

        foreach ($this->modules as $module) {
            if ($command->option('verbose')) {
                $command->call('module:migrate', ['module' => $module]);
                continue;
            }
            $command->callSilent('module:migrate', ['module' => $module]);
        }
    }
1171419
public function start($command)
    {
        $this->startWorkers($command);
        while ($this->isWorking()) {
            $worker = $this->getAvailableWorker();

            if ($worker && ! empty($this->pending)) {
                $worker->run(array_shift($this->pending));
            }

            $this->broker->read();
        }
    }
362454
public function exec($command)
    {
        $this->_events[] = $event = new Event($this->_mutex, $command);
        return $event;
    }
1013684
protected function runCommand($command)
    {
        $process = $this->getProcess();

        $process->setCommandLine(trim($this->find() . ' ' . $command));

        $process->run();

        return $this;
    }
530107
static function executeCommand($command)
    {
        exec($command, $output, $resultCode);

        if ($resultCode > 0) {
            $output = implode("\n", $output);
            throw new Exception("Failed to execute command: '$command' with output: '$output' ");
        }
    }