Register default command handlers.
191227
protected function addDefaultCommands() {
        $this->addCommands([
            new GlobalVersionCommand(),
            new GlobalFormatCommand(),
            new GlobalSilentModeCommand(),
            new GlobalNoInteractionCommand(),
            new GlobalHelpCommand(),
            new GlobalVerbosityCommand(),
            new GlobalPassthroughCommand(),
            new ListCommand(),
            new HelpCommand(),
        ]);
    }
239066
def add_cmd_handler(self, cmd, func):
        """"""
        len_args = len(inspect.getargspec(func)[0])

        def add_meta(f):
            def decorator(*args, **kwargs):
                f(*args, **kwargs)
            decorator.bytes_needed = len_args - 1  # exclude self
            decorator.__name__ = f.__name__
            return decorator
        func = add_meta(func)
        self._command_handlers[cmd] = func
867053
def add_startup_handler(self, handler):
        """"""
        if not self.startup_handlers:
            self._startup_handlers = []

        self.startup_handlers.append(handler)
1269890
protected function getDefaultCommands()
    {

        $shell = new Shell(dirname(VENDOR_PATH));

        $handlers = [
            'source' => new Handler\Source($shell),
            'coverage' => new Handler\Coverage(),
            'pdepend' => new Handler\PDepend($shell),
            'dependencies' => new Handler\Dependencies($shell),
            'phpmd' => new Handler\PHPMD($shell),
            'checkstyle' => new Handler\Checkstyle($shell),
            'tests' => new Handler\Tests(),
            'cpd' => new Handler\CPD($shell),
            'phploc' => new Handler\Phploc($shell),
            'git' => new Handler\Git($shell),
            'gitDetailed' => new Handler\GitDetailed($shell),
        ];

        return array_merge(
            parent::getDefaultCommands(),
            [
                new Command\Serve(),
                new Command\Bundle(),
                new Command\Analyze($handlers),
                new Command\Analyzers($handlers),
            ]
        );
    }
949400
private function registerMapping()
    {
        /* @var \Swoft\Console\Router\HandlerMapping $route */
        $route = App::getBean('commandRoute');

        $commandMapping = CommandCollector::getCollector();
        $route->register($commandMapping);
    }
883716
def set_default_command(self, command):
        """"""
        cmd_name = command.name
        self.add_command(command)
        self.default_cmd_name = cmd_name
396462
def handlers(self):
        """"""
        if getattr(self, '_http'):
            yield from self.http.handlers()
        if getattr(self, '_cli'):
            yield from self.cli.handlers()
833543
protected function registerConsoleCommands()
    {
        $this->commands(AssetCommand::class);
        $this->commands(ThemeCommand::class);
        $this->commands(InstallCommand::class);
        $this->commands(GenerateDocumentationCommand::class);
    }
547549
protected function registerCommands()
    {
        $this->app['iverberk.larasearch.commands.reindex'] = $this->app->share(function ($app)
        {
            return new ReindexCommand();
        });

        $this->app['iverberk.larasearch.commands.paths'] = $this->app->share(function ($app)
        {
            return new PathsCommand();
        });

        $this->commands('iverberk.larasearch.commands.reindex');
        $this->commands('iverberk.larasearch.commands.paths');
    }
1188401
public function registerConsole()
    {
        $this->commands(TypeMakeCommand::class);
        $this->commands(QueryMakeCommand::class);
        $this->commands(MutationMakeCommand::class);
    }
170236
protected function registerCommands()
    {
        if ($this->app->runningInConsole()) {
            $this->commands([
                Console\InstallCommand::class,
                Console\AssetsCommand::class,
                Console\HorizonCommand::class,
                Console\ListCommand::class,
                Console\PurgeCommand::class,
                Console\PauseCommand::class,
                Console\ContinueCommand::class,
                Console\StatusCommand::class,
                Console\SupervisorCommand::class,
                Console\SupervisorsCommand::class,
                Console\TerminateCommand::class,
                Console\TimeoutCommand::class,
                Console\WorkCommand::class,
            ]);
        }

        $this->commands([Console\SnapshotCommand::class]);
    }
1222032
public function registerCommands()
	{
		$this->app['foruminstallcommand'] = $this->app->share(function($app)
        {
            return new InstallCommand;
        });
		$this->commands('foruminstallcommand');
	}
445036
protected function defaultCommandVariables()
    {
        $this->type     = NULL;
        $this->path     = NULL;
        $this->command  = NULL;
        $this->debug    = false;
    }
1165205
private function registerCommands()
    {
        $this->app['commands.drawbridge.migrations'] = $this->app->share(function($app)
        {
            return new MigrationsCommand($app);
        });

        $this->commands(
            array(
                 'commands.drawbridge.migrations'
            )
        );
    }
1372743
protected function registerCommands()
    {
        $this->commands(Commands\SetupCommand::class);
        $this->commands(Commands\MakeCommand::class);
        $this->commands(Commands\InstallCommand::class);
        $this->commands(Commands\UninstallCommand::class);
        $this->commands(Commands\UpdateCommand::class);
        $this->commands(Commands\CheckCommand::class);
        $this->commands(Commands\EnableCommand::class);
        $this->commands(Commands\DisableCommand::class);
        $this->commands(Commands\InfoCommand::class);
        $this->commands(Commands\ListCommand::class);
    }
1016189
private function registerConsoleCommands()
    {
        $this->registerMakeCommand();
        $this->registerEnableCommand();
        $this->registerDisableCommand();
        $this->registerListCommand();
        $this->registerMigrateCommand();
        $this->registerMigrateRefreshCommand();
        $this->registerMakeMigrationCommand();
        $this->registerMakeRequestCommand();
        $this->registerMakeModelCommand();

        $this->commands([
            'pluggables.makeMigration',
            'pluggables.enable',
            'pluggables.disable',
            'pluggables.list',
            'pluggables.make',
            'pluggables.make.request',
            'pluggables.make.model',
            'pluggables.migrate',
            'pluggables.migrateRefresh',
        ]);
    }
1306117
def dispatch_command(self, command, params=None):
        """"""
        try:
            if command in self.handlers:
                self.handlers[command](**params)
            else:
                logging.warning('Unsupported command: %s: %s',
                                command, params)
        except Exception as e:
            logging.warning('Error during command execution',
                            exc_info=sys.exc_info())
            raise e