Gets the full cli schema.

@param string $command The name of the command. This can be left blank if there is no command.
@return array Returns the schema that matches the command.
175541
public function getSchema($command = '') {
        $result = [];
        foreach ($this->commandSchemas as $pattern => $opts) {
            if (fnmatch($pattern, $command)) {
                $result = array_replace_recursive($result, $opts);
            }
        }
        return $result;
    }
575247
public function getCommandHandler($command)
    {
        if ($this->hasCommandHandler($command)) {
            return $this->container->make($this->handlers[get_class($command)]);
        }

        return false;
    }
620945
public function getCallbacks($command)
    {
        $result = array();
        $command = strtolower($command);

        if (isset($this->_callbacks[$command])) {
            $result = $this->_callbacks[$command];
        }

        return $result;
    }
71829
public function hasOptions($command = '') {
        if ($command) {
            $def = $this->getSchema($command);
            return $this->hasOptionsDef($def);
        } else {
            foreach ($this->commandSchemas as $pattern => $def) {
                if ($this->hasOptionsDef($def)) {
                    return true;
                }
            }
        }
        return false;
    }
70139
public function getCommand($commandName)
    {
        $command = '';
        $possible = array();

        foreach ($this->commands as $values) {
            $command = $values['command'];

            if (preg_match("#" . $command . "#", $commandName)) {
                $possible[] = $values;
            }
        }

        if (sizeof($possible) == 1) {
            return $possible[0];
        }

        if (sizeof($possible)) {
            $index = 0;
            if (isset($this->commandsRuns[$command])) {
                if (sizeof($possible) <= $this->commandsRuns[$command]) {
                    $this->commandsRuns[$command] = 0;
                }

                $index = $this->commandsRuns[$command];
            }

            return $possible[$index];
        }

        return false;
    }
997866
public static function getCommandDescription(WebDriver_Command $command)
    {
        $commandDescriptionList = [
            "Command: {$command->getCommandName()}",
            "Method: {$command->getMethod()}",
            "URL: {$command->getUrl()}"
        ];
        $paramList = $command->getParameters();
        if (!empty($paramList)) {
            $commandDescriptionList = array_merge(
                $commandDescriptionList,
                ["Parameters:", var_export($paramList, true)]
            );
        }
        return implode("\n", $commandDescriptionList);
    }
862620
public function resolveCommand($command)
    {
        if ($fullPaths = $this->findWhere($command)) {
            $fullPaths = preg_split('/[\r\n]/', trim($fullPaths));
            $command = end($fullPaths);
        }

        return $command;
    }
491866
protected function filterArtisanCommand($command)
    {
        $parts = explode(" ", $command);

        if (isset($parts[2])) {
            if (str_contains(strtolower($parts[0]), 'php') && str_contains(strtolower($parts[1]), 'artisan')) {
                unset($parts[0]);
                unset($parts[1]);
                return implode(" ", $parts);
            }
        }

        return $command;
    }
1017823
public function getProcessByCommand(string $command) : Process {
        if( ! array_key_exists($command, $this->processes) ) {
            $this->watch($command);
        }

        foreach($this->getWatchedProcesses() as $process) {
            if($process->getCommand() === $command) {
                return $process;
            }
        }
    }
796456
public function execute(string $command): string
    {
        $result = shell_exec($command);
        if ($result === null) {
            $result = '';
        }
        return $result;
    }
27836
public function getCommandConfiguration($command)
    {
        $url = "selendroid/configure/command/{$command}";
        $result = $this->driver->curl($this->driver->factoryCommand($url, WebDriver_Command::METHOD_GET));
        return isset($result['value']) ? $result['value'] : [];
    }
836602
public function getPrettyFormat($command)
    {
        $output = $this->getClient()->run($this, $command);
        $format = new PrettyFormat();

        return $format->parse($output);
    }
1196850
public function match(Command $command)
    {
        if ($this->isEmpty()) {
            return false;
        }
        if ($this->isRegExp()) {
            return 1 === preg_match($this->getName(), $command->getName());
        }
        return $command->getName() === $this->getName();
    }
1328667
public static function parse(array $commands)
    {
        $cli = array();

        parse_str(implode('&', array_slice($commands, 1)), $cli);

        $command = current(array_keys((array)$cli, ''));

        if (Str::contains($command, ':')) {

            list($controller, $action) = explode(':', $command);

            $cli['controller'] = $controller;
            $cli['action'] = $action;
        }

        return $cli;
    }
761885
public static function getExecutable($command) : string
    {
        if (is_executable($command)) {
            return $command;
        }
        // on windows check the .exe suffix
        if (defined('PHP_WINDOWS_VERSION_BUILD')) {
            $command .= '.exe';
            if (is_executable($command)) {
                return $command;
            }
        }
        return '';
    }
1238818
public function getCommand($command): Command
    {
        if (isset($this->aliases[$command])) {
            return $this->aliases[$command];
        }

        if (isset($this->commands[$command])) {
            return $this->commands[$command];
        }

        throw new CommandNotFoundException($this, $command);
    }
1337409
protected function getCommandType($command) {
        if (is_object($command)) {
            return get_class($command);
        }

        throw new InvalidCommandException(
            s('Command must be an object, %s received.', get_type($command))
        );
    }