List all admin commands.

@return void
17681
protected function listAdminCommands()
    {
        $commands = collect(Artisan::all())->mapWithKeys(function ($command, $key) {
            if (Str::startsWith($key, 'admin:')) {
                return [$key => $command];
            }

            return [];
        })->toArray();

        $width = $this->getColumnWidth($commands);

        /** @var Command $command */
        foreach ($commands as $command) {
            $this->line(sprintf(" %-{$width}s %s", $command->getName(), $command->getDescription()));
        }
    }
1103265
public function index()
    {
        $permissions = $this->GroupPermissions->find('all')
            ->contain(['Groups'])
            ->order([
                'Groups.name' => 'ASC',
                'path' => 'ASC'
            ])
            ->hydrate(false)
            ->toArray();

        $plugins = [];
        if (!empty($permissions)) {
            foreach ($permissions as $p) {
                $plugin = $p['plugin'];
                $controller = $p['controller'];
                $action = $p['action'];
                $groupId = $p['group']['id'];
                $plugins[$plugin][$controller][$action][$groupId]['permission_id'] = $p['id'];
                $plugins[$plugin][$controller][$action][$groupId]['name'] = $p['group']['name'];
                $plugins[$plugin][$controller][$action][$groupId]['allowed'] = $p['allowed'];
            }
        }

        $this->set([
            'plugins' => $plugins,
            'permission' => $this->GroupPermissions->newEntity()
        ]);
    }
972153
public function registerCommands()
    {
        if (! $this->app->runningInConsole()) {
            return;
        }

        foreach ($this->commands as $command) {
            $this->commands($command);
        }
    }
1257998
public function executeCommands()
    {
        $commands = $this->getCommands();
        foreach ($commands as $command) {
            call_user_func_array([$this->getAdapter(), $command['name']], $command['arguments']);
        }
    }
501409
private function adminModules()
    {
        $return = [];

        foreach ($this->app[ 'config' ]->get('modules.all') as $module) {
            $controller = '\\app\\'.$module.'\\Controller';

            if (!class_exists($controller)) {
                continue;
            }

            if (property_exists($controller, 'scaffoldAdmin') ||
                property_exists($controller, 'hasAdminView')) {
                $moduleInfo = [
                    'name' => $module,
                    'title' => Inflector::get()->titleize($module), ];

                if (property_exists($controller, 'properties')) {
                    $moduleInfo = array_replace($moduleInfo, $controller::$properties);
                }

                $return[] = $moduleInfo;
            }
        }

        return $return;
    }
804433
def list_commands(self, *path):
        """"""
        path_str = ':'.join(path)

        commands = []
        for command in self.commands:

            # Filter based on prefix and the segment length
            if all([command.startswith(path_str),
                    len(path) == command.count(":")]):

                # offset is used to exclude the path that the caller requested.
                offset = len(path_str) + 1 if path_str else 0
                commands.append(command[offset:])

        return sorted(commands)
568709
public function help()
    {
        echo PHP_EOL;
        $output = new Output;
        $output->write('Available Commands', [
            'color'     => 'red',
            'bold'      => true,
            'underline' => true,
        ]);
        echo PHP_EOL;

        $maxlen = 0;
        foreach ($this->supportedArgs as $key => $description) {
            $len = strlen($key);
            if ($len > $maxlen) {
                $maxlen = $len;
            }

        }

        foreach ($this->supportedArgs as $key => $description) {
            $len = strlen($key);
            $output->write(' ')
                ->write($key, ['color' => 'yellow'])
                ->write(str_repeat(' ', $maxlen - $len))
                ->write(' - ')
                ->write($description);

            echo PHP_EOL;
        }

        echo PHP_EOL;

    }
413241
private function availableCommands()
    {
        return [
            self::INSTALL,
            self::UPDATE,
            self::DUMP_AUTOLOAD,
            self::DOWNLOAD,
            self::REMOVE,
        ];
    }
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;
    }
120436
final public function showCommandList(): void
    {
        $this->beforeShowCommandList();

        $ref   = new \ReflectionClass($this);
        $sName = \lcfirst(self::getName() ?: $ref->getShortName());

        if (!($classDes = self::getDescription())) {
            $classDes = PhpDoc::description($ref->getDocComment()) ?: 'No description for the command group';
        }

        $commands     = [];
        $showDisabled = (bool)$this->getOpt('show-disabled', false);
        $defaultDes   = 'No description message';

        foreach ($this->getAllCommandMethods($ref) as $cmd => $m) {
            if (!$cmd) {
                continue;
            }

            $desc = PhpDoc::firstLine($m->getDocComment()) ?: $defaultDes;

            // is a annotation tag
            if (\strpos($desc, '@') === 0) {
                $desc = $defaultDes;
            }

            if ($this->isDisabled($cmd)) {
                if (!$showDisabled) {
                    continue;
                }

                $desc .= '[<red>DISABLED</red>]';
            }

            $aliases = $this->getCommandAliases($cmd);
            $desc    .= $aliases ? ColorTag::wrap(' [alias: ' . \implode(',', $aliases) . ']', 'info') : '';

            $commands[$cmd] = $desc;
        }

        // sort commands
        \ksort($commands);

        // move 'help' to last.
        if ($helpCmd = $commands['help'] ?? null) {
            unset($commands['help']);
            $commands['help'] = $helpCmd;
        }

        $script = $this->getScriptName();

        if ($this->executionAlone) {
            $name  = $sName . ' ';
            $usage = "$script <info>{command}</info> [--options ...] [arguments ...]";
        } else {
            $name  = $sName . $this->delimiter;
            $usage = "$script {$name}<info>{command}</info> [--options ...] [arguments ...]";
        }

        $globalOptions = \array_merge(Application::getGlobalOptions(), static::$globalOptions);

        $this->output->startBuffer();
        $this->output->write(\ucfirst($classDes) . \PHP_EOL);
        $this->output->mList([
            'Usage:'              => $usage,
            //'Group Name:' => "<info>$sName</info>",
            'Global Options:'     => FormatUtil::alignOptions($globalOptions),
            'Available Commands:' => $commands,
        ], [
            'sepChar' => '  ',
        ]);

        $this->write(\sprintf(
            'More information about a command, please use: <cyan>%s %s{command} -h</cyan>',
            $script,
            $this->executionAlone ? '' : $name
        ));
        $this->output->flush();
    }
873848
def _manage_commands():
    
    for name, (command, *aliases) in COMMANDS.items():
        COMMAND_MAPPER[name] = command
        for alias in aliases:
            COMMAND_MAPPER[alias] = command
        COMMAND_ALIASES[name] = aliases
1305908
protected function listRunnables()
	{
		$commands = array_values(Command::getRegisteredCommands());
		$format = "| %8.60s | %-50.30s\n";
		
		printf($format, "id", "class");
		$this->env->sendOutput('-----------------------------------');
		foreach($commands as $runnable) {
			printf($format, $runnable->getId(), get_class($runnable));
			$this->env->sendOutput('-----------------------------------');
		}
	}
1023975
protected function getCommands()
    {
        $commands = [];

        foreach ($this->getApplication()->all() as $name => $command) {
            if (in_array($name, $this->commandWhitelist)) {
                $commands[] = $command;
            }
        }

        foreach (config('tinker.commands', []) as $command) {
            $commands[] = $this->getApplication()->resolve($command);
        }

        return $commands;
    }
1166892
def all_commands
      commands = @command_class.all_commands.reject do |k,v|
        v.is_a?(Thor::HiddenCommand)
      end
      commands.keys
    end
175621
public function listCommand()
    {
        $workspaces = $this->workspaceRepository->findAll();

        if ($workspaces->count() === 0) {
            $this->outputLine('No workspaces found.');
            $this->quit(0);
        }

        $tableRows = [];
        $headerRow = ['Name', 'Base Workspace', 'Title', 'Owner', 'Description'];

        foreach ($workspaces as $workspace) {
            $owner = $workspace->getOwner() ? $workspace->getOwner()->getName() : '';
            $tableRows[] = [$workspace->getName(), ($workspace->getBaseWorkspace() ? $workspace->getBaseWorkspace()->getName() : ''), $workspace->getTitle(), $owner, $workspace->getDescription()];
        }
        $this->output->outputTable($tableRows, $headerRow);
    }
306397
public function getVisibleCommands(): array
    {
        $commands = [];
        foreach ($this->commands as $name => $command) {
            if ($name[0] === '_') {
                continue;
            }

            $commands[$name] = $command;
        }

        return $commands;
    }
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;
	}