Returns an array of command information.

@return array
185678
protected function getCommands(): array
	{
		$info = [];

		foreach($this->commands as $name => $class)
		{
			$command = $this->instantiateCommandWithoutConstructor($class);

			$info[$name] = [$name, $command->getCommandDescription()];
		}

		ksort($info);

		return $info;
	}
41137
public function getParams()
    {
        if ($this->cachedParams) {
            return $this->cachedParams;
        }

        $CMDS = [];
        $KEYS = [];
        $ARGV = [];
        $KEYNUM = 0;
        $ARGNUM = 0;

        foreach ($this->stack as $part) {
            list($cmd, $keys, $argv) = $part;

            if (!empty($keys)) {
                $cmd = preg_replace_callback('~KEYS\[(\d+)\]~', function ($m) use (&$KEYS, &$KEYNUM, $keys) {
                    $key = $keys[$m[1] - 1];
                    if (!isset($KEYS[$key])) {
                        $KEYS[$key] = ++$KEYNUM;
                    }
                    return 'KEYS[' . $KEYS[$key] . ']';
                }, $cmd);
            }

            if (!empty($argv)) {
                $cmd = preg_replace_callback('~ARGV\[(\d+)\]~', function ($m) use (&$ARGV, &$ARGNUM, $argv) {
                    $arg = $argv[$m[1] - 1];
                    if (!isset($ARGV[$arg])) {
                        $ARGV[$arg] = ++$ARGNUM;
                    }
                    return 'ARGV[' . $ARGV[$arg] . ']';
                }, $cmd);
            }

            $CMDS[] = $cmd;
        }

        return $this->cachedParams = array_merge(
            [implode(';', $CMDS), count($KEYS)],
            array_keys($KEYS),
            array_keys($ARGV)
        );
    }
1026296
protected function getDefaultCommands()
    {
        $commands = parent::getDefaultCommands();
        $commands[] = new Command\AboutCommand();
        $commands[] = new Command\ConfigCommand();
        $commands[] = new Command\DependsCommand();
        $commands[] = new Command\InitCommand();
        $commands[] = new Command\InstallCommand();
        $commands[] = new Command\CreateProjectCommand();
        $commands[] = new Command\UpdateCommand();
        $commands[] = new Command\SearchCommand();
        $commands[] = new Command\ValidateCommand();
        $commands[] = new Command\ShowCommand();
        $commands[] = new Command\RequireCommand();
        $commands[] = new Command\DumpAutoloadCommand();
        $commands[] = new Command\StatusCommand();
        $commands[] = new Command\ArchiveCommand();
        $commands[] = new Command\DiagnoseCommand();
        $commands[] = new Command\RunScriptCommand();
        $commands[] = new Command\LicensesCommand();
        $commands[] = new Command\GlobalCommand();
        $commands[] = new Command\ClearCacheCommand();
        $commands[] = new Command\RemoveCommand();
        $commands[] = new Command\HomeCommand();

        if ('phar:' === substr(__FILE__, 0, 5)) {
            $commands[] = new Command\SelfUpdateCommand();
        }

        return $commands;
    }
600328
protected function getCommandDescriptions()
    {
        $commands = [];
        foreach ($this->getCommands() as $command) {
            $actions = [];
            $result = Yii::$app->createController($command);
            if ($result !== false && $result[0] instanceof \Hprose\Yii\Controller) {
                list($controller) = $result;
                /** @var Controller $controller */
                $actions = $this->getActions($controller);
            }

            $commands[$command] = $actions;
        }

        return $commands;
    }
1094675
public function listCommand(): void
    {
        $list = [
            'The is a list line 0',
            'The is a list line 1',
            'The is a list line 2',
            'The is a list line 3',
        ];

        Show::aList($list, 'a List show(No key)');

        $commands = [
            'version' => 'Show application version information',
            'help'    => 'Show application help information',
            'list'    => 'List all group and independent commands',
            'a only value message text'
        ];

        Show::aList($commands, 'a List show(Has key)');
    }
644429
public function toArray() : array {
        return [
            'command'   => $this->getCommand(),
            'running'   => $this->isRunning(),
            'info'      => $this->getInfo() ? $this->getInfo()->toArray() : null,
        ];
    }
222966
protected function getDefaultCommands()
	{
		$commands = parent::getDefaultCommands();
		$commands[] = new ShowCommand($this->getComposerAccessor());
		$commands[] = new SelfUpdateCommand($this->getVictorUpdater());

		$this->setDefaultCommand(ShowCommand::NAME);

		return $commands;
	}
605842
protected function getDefaultCommands()
    {
        $sudo = new Command\SudoCommand();
        $sudo->setReadline($this->readline);

        $hist = new Command\HistoryCommand();
        $hist->setReadline($this->readline);

        return [
            new Command\HelpCommand(),
            new Command\ListCommand(),
            new Command\DumpCommand(),
            new Command\DocCommand(),
            new Command\ShowCommand($this->config->colorMode()),
            new Command\WtfCommand($this->config->colorMode()),
            new Command\WhereamiCommand($this->config->colorMode()),
            new Command\ThrowUpCommand(),
            new Command\TimeitCommand(),
            new Command\TraceCommand(),
            new Command\BufferCommand(),
            new Command\ClearCommand(),
            new Command\EditCommand($this->config->getRuntimeDir()),
            // new Command\PsyVersionCommand(),
            $sudo,
            $hist,
            new Command\ExitCommand(),
        ];
    }
766926
protected function getDefaultCommands()
    {
        $commands = parent::getDefaultCommands();
        $commands[] = new InitCommand();
        $commands[] = new InstallReleaseCommand();
        $commands[] = new DeployReleaseCommand();

        return $commands;
    }
898438
protected function _getCommand()
        {
            $command = $this->_bin;

            $command .= ($this->getCopies() > 1) ? " --copies " . $this->getCopies() : "";
            $command .= " --orientation " . $this->getOrientation();
            $command .= " --page-size " . $this->getPageSize();

            foreach($this->getMargins() as $position => $margin) {
                $command .= (false === is_null($margin)) ? sprintf(' --margin-%s %s', $position, $margin) : '';
            }

            $command .= ($this->getWindowStatus()) ? " --window-status ".$this->getWindowStatus()."" : "";
            $command .= ($this->getTOC()) ? " --toc" : "";
            $command .= ($this->getGrayscale()) ? " --grayscale" : "";
            $command .= (mb_strlen($this->getPassword()) > 0)
            ? " --password " . $this->getPassword() . ""
            : "";
            $command .= (mb_strlen($this->getUsername()) > 0)
            ? " --username " . $this->getUsername() . ""
            : "";
            $command .= (mb_strlen($this->getFooterHtml()) > 0)
            ? " --margin-bottom 20 --footer-html \"" . $this->getFooterHtml() . "\""
            : "";
            $command .= ($this->getTitle())
            ? ' --title "' . $this->getTitle() . '"'
            : '';

            $command .= ' "%input%"';
            $command .= " -";
            if ($this->getRunInVirtualX()) {
                $command = 'xvfb-run ' . $command;
            }
            return $command;
        }
176738
protected function get_js_commands()
    {
        $out = '';

        foreach ($this->commands as $i => $args) {
            $method = array_shift($args);
            foreach ($args as $i => $arg) {
                $args[$i] = self::json_serialize($arg, $this->devel_mode, false);
            }

            $out .= sprintf(
                "this.%s(%s);\n",
                preg_replace('/^parent\./', '', $method),
                implode(',', $args)
            );
        }

        return $out;
    }
439738
public function listCommand()
    {
        $rows = [];
        foreach ($this->queueConfigurations as $queueName => $queueConfiguration) {
            $queue = $this->queueManager->getQueue($queueName);
            try {
                $numberOfMessages = $queue->countReady();
            } catch (\Exception $e) {
                $numberOfMessages = '-';
            }
            $rows[] = [$queue->getName(), TypeHandling::getTypeForValue($queue), $numberOfMessages];
        }
        $this->output->outputTable($rows, ['Queue', 'Type', '# messages']);
    }
214132
protected function getPhpMigCommands()
    {
        return [
            new Command\CheckCommand(),
            new Command\DownCommand(),
            new Command\GenerateCommand(),
            new Command\MigrateCommand(),
            new Command\RedoCommand(),
            new Command\RollbackCommand(),
            new Command\StatusCommand(),
            new Command\UpCommand(),
        ];
    }
515085
private function parserCmdAndDesc(): array
    {
        $commands = [];
        $collector = CommandCollector::getCollector();

        /* @var \Swoft\Console\Router\HandlerMapping $route */
        $route = App::getBean('commandRoute');

        foreach ($collector as $className => $command) {
            if (!$command['enabled']) {
                continue;
            }

            $rc = new \ReflectionClass($className);
            $docComment = $rc->getDocComment();
            $docAry = DocBlockHelper::getTags($docComment);

            $prefix = $command['name'];
            $prefix = $route->getPrefix($prefix, $className);
            $commands[$prefix] = StringHelper::ucfirst($docAry['Description']);
        }

        // sort commands
        ksort($commands);

        return $commands;
    }
730302
protected function getListCommands()
    {
        $commands = $this->application->all();
        $commandsArray = array();
        
        foreach ($commands as $command) {
            $commandsArray[] = array(
                'class'   => get_class($command),
                'name'    => $command->getName()
            );
        }
        
        return $commandsArray;
    }
1354878
protected function getDefaultCommands() : array
    {
        return [
            new Cmd\Help(),
            new Cmd\Install(),
            new Cmd\Configuration(),
            new Cmd\Add(),
            new Cmd\Disable(),
            new Cmd\Enable(),
            new Cmd\Run(),
        ];
    }
638862
protected function getCommands()
    {
        return \array_merge($this->commands, [
            \Illuminate\Console\Scheduling\ScheduleRunCommand::class,
            \Laravel\Lumen\Console\Commands\ServeCommand::class,
        ]);
    }