Register the Commands and add the Menu Items, if required
501776
function initializeCommands() {
        var prefs = getPreferences();

        CommandManager.register(Strings.CMD_FILE_CLOSE_BELOW, closeBelow, function () {
            handleClose(closeBelow);
        });
        CommandManager.register(Strings.CMD_FILE_CLOSE_OTHERS, closeOthers, function () {
            handleClose(closeOthers);
        });
        CommandManager.register(Strings.CMD_FILE_CLOSE_ABOVE, closeAbove, function () {
            handleClose(closeAbove);
        });

        if (prefs.closeBelow) {
            workingSetListCmenu.addMenuItem(closeBelow, "", Menus.AFTER, Commands.FILE_CLOSE);
        }
        if (prefs.closeOthers) {
            workingSetListCmenu.addMenuItem(closeOthers, "", Menus.AFTER, Commands.FILE_CLOSE);
        }
        if (prefs.closeAbove) {
            workingSetListCmenu.addMenuItem(closeAbove, "", Menus.AFTER, Commands.FILE_CLOSE);
        }
        menuEntriesShown = prefs;
    }
1363590
def setup_menu(self):
        """"""
        self.copy_action = create_action(self, _('Copy'),
                                         shortcut=keybinding('Copy'),
                                         icon=ima.icon('editcopy'),
                                         triggered=self.copy,
                                         context=Qt.WidgetShortcut)
        menu = QMenu(self)
        add_actions(menu, [self.copy_action, ])
        return menu
384815
protected function registerMultiSiteConsoleCommands()
    {
        $this->commands([
            Console\TenantListCommand::class,
            Console\TenantRouteListCommand::class,
            Console\TenantRouteCacheCommand::class,
            Console\TenantRouteClearCommand::class,
        ]);
    }
126657
protected function registerConsoleCommands(): void
    {
        if ($this->app->runningInConsole()) {
            $this->app->bind('command.ban:delete-expired', DeleteExpiredBans::class);

            $this->commands([
                'command.ban:delete-expired',
            ]);
        }
    }
1102720
public function registerConsoleCommands()
    {
        $this->commands([
            \Plank\Mediable\Commands\ImportMediaCommand::class,
            \Plank\Mediable\Commands\PruneMediaCommand::class,
            \Plank\Mediable\Commands\SyncMediaCommand::class,
        ]);
    }
220401
protected function registerCustomCommands()
    {
        // Keep the core default commands to have the HelpCommand
        // which is used when using the --help option
        $defaultCommands = parent::getDefaultCommands();

        // Automatically register commands by scanning namespaces for a 'DroidPlugin' class.
        //print_r($this->autoLoader);
        $prefixes = $this->autoLoader->getPrefixesPsr4();

        foreach ($prefixes as $namespace => $paths) {
            $className = $namespace . 'DroidPlugin';
            if (class_exists($className)) {
                $plugin = new $className($this);
                $commands = $plugin->getCommands();
                foreach ($commands as $command) {
                    $this->add($command);
                }
            }
        }

        foreach ($this->all() as $command) {
            if (method_exists($command, 'setInventory')) {
                $command->setInventory($this->inventory);
            }
        }

        if ($this->hasProject()) {
            $runner = new TaskRunner(
                $this,
                $this->transformer,
                new LoggerFactory,
                new ExpressionLanguage,
                $this->buildLegacyTransformer()
            );
            $enabler = $this->configureHostEnabler();
            if (! $enabler) {
                # TODO output a warning about not being able to run remote cmds
            } else {
                $runner->setEnabler($enabler);
            }
            foreach ($this->getProject()->getTargets() as $target) {
                $command = new BaseTargetCommand;
                $command->setName($target->getName());
                $command->setDescription("Run target: " . $target->getName());
                $command->setTarget($target->getName());
                $command->setTaskRunner($runner);
                foreach ($target->getArguments() as $argument) {

                    $required = InputArgument::OPTIONAL;
                    if ($argument->getRequired()) {
                        $required = InputArgument::REQUIRED;
                    }

                    $command->addArgument(
                        $argument->getName(),
                        $required,
                        $argument->getDescription()
                    );
                }
                $this->add($command);
            }
        }
    }
1109415
private function registerCommands()
    {
        //scheduled:summary
        $this->app->bindShared('command.scheduled.summary', function (Application $app) {
            return $app->make('Indatus\Dispatcher\Commands\ScheduleSummary');
        });

        //scheduled:make
        $this->app->bindShared('command.scheduled.make', function (Application $app) {
            return $app->make('Indatus\Dispatcher\Commands\Make');
        });

        //scheduled:run
        $this->app->bindShared('command.scheduled.run', function (Application $app) {
            return $app->make('Indatus\Dispatcher\Commands\Run');
        });

        $this->commands($this->provides());
    }
1112182
def register_menu_item(self, items):
        
        for itm in items:
            if itm.group in self.menu_items:
                # Only add the menu item if we don't already have it registered
                if itm not in self.menu_items[itm.group]['items']:
                    self.menu_items[itm.group]['items'].append(itm)
            else:
                logger.warning('Tried registering menu item to unknown group {}'.format(itm.group))
716284
protected function registerMenu()
    {
        \Menu::make('ChronosMenu', function($menu) {
//            $menu->add(trans('chronos.scaffolding::menu.Dashboard'), ['route' => 'chronos.dashboard'])
//                ->prepend('<span class="icon c4icon-dashboard"></span>')
//                ->data('order', 1)->data('permissions', ['view_dashboard']);


            // Users tab
            $users_menu = $menu->add(trans('chronos.scaffolding::menu.Users'), null)
                ->prepend('<span class="icon c4icon-user-3"></span>')
                ->data('order', 800)->data('permissions', ['view_roles', 'edit_permissions']);
            $users_menu->add(trans('chronos.scaffolding::menu.Roles'), ['route' => 'chronos.users.roles'])
                ->data('order', 810)->data('permissions', ['view_roles']);
            $users_menu->add(trans('chronos.scaffolding::menu.Permissions'), ['route' => 'chronos.users.permissions'])
                ->data('order', 820)->data('permissions', ['edit_permissions']);

            // Settings tab
            $settings_menu = $menu->add(trans('chronos.scaffolding::menu.Settings'), null)
                ->prepend('<span class="icon c4icon-sliders-1"></span>')
                ->data('order', 900)->data('permissions', ['edit_settings', 'edit_access_tokens', 'edit_image_styles']);
            $settings_menu->add(trans('chronos.scaffolding::menu.Access tokens'), ['route' => 'chronos.settings.access_tokens'])
                ->data('order', 910)->data('permissions', ['edit_access_tokens']);
            $settings_menu->add(trans('chronos.scaffolding::menu.Image styles'), ['route' => 'chronos.settings.image_styles'])
                ->data('order', 910)->data('permissions', ['view_image_styles']);
        });

        \View::composer('*', function($view) {
            $view->with('chronos_menu', \Menu::get('ChronosMenu')->sortBy('order'));
        });
    }
386353
protected function addImpliedCommands()
    {
        if (count($this->columns) > 0 && ! $this->creating()) {
            array_unshift($this->commands, $this->createCommand('add'));
        }

        $this->addFluentIndexes();
    }
1283543
function addCommand() {
        CommandManager.register(Strings.CMD_HEALTH_DATA_STATISTICS, healthDataCmdId, handleHealthDataStatistics);

        menu.addMenuItem(healthDataCmdId, "", Menus.AFTER, Commands.HELP_SHOW_EXT_FOLDER);
        menu.addMenuDivider(Menus.AFTER, Commands.HELP_SHOW_EXT_FOLDER);
    }
442605
public function registerCommandPlugins()
    {
        $spress = $this->getSpress();

        try {
            $pm = $spress['spress.plugin.pluginManager'];

            $commandBuilder = new ConsoleCommandBuilder($pm);
            $consoleCommandFromPlugins = $commandBuilder->buildCommands();

            foreach ($consoleCommandFromPlugins as $consoleCommand) {
                $this->add($consoleCommand);
            }
        } catch (\Exception $e) {
        }
    }
1091505
function( editor, buttonName, buttonLabel, commandName, command, menugroup, menuOrder )
	{
		editor.addCommand( commandName, command );

		// If the "menu" plugin is loaded, register the menu item.
		editor.addMenuItem( commandName,
			{
				label : buttonLabel,
				command : commandName,
				group : menugroup,
				order : menuOrder
			});
	}
559863
protected function registerConsoleCommands()
    {
        $this->commands([
            InfoCommand::class,
            SchemaCreateCommand::class,
            SchemaUpdateCommand::class,
            SchemaDropCommand::class,
            SchemaValidateCommand::class,
            ClearMetadataCacheCommand::class,
            ClearResultCacheCommand::class,
            ClearQueryCacheCommand::class,
            EnsureProductionSettingsCommand::class,
            GenerateProxiesCommand::class
        ]);
    }
80779
protected function registerCommands()
    {
        $this->app->singleton('cms.commands.user-create', CreateUser::class);
        $this->app->singleton('cms.commands.user-delete', DeleteUser::class);

        $this->commands([
            'cms.commands.user-create',
            'cms.commands.user-delete',
        ]);

        return $this;
    }
182550
private function registerCommands()
    {
        $commands = [
            'arbory.seed' => SeedCommand::class,
            'arbory.install' => InstallCommand::class,
            'arbory.generator' => GeneratorCommand::class,
            'arbory.generate' => GenerateCommand::class
        ];

        foreach( $commands as $containerKey => $commandClass )
        {
            $this->registerCommand( $containerKey, $commandClass );
        }
    }
720241
protected function registerCommands()
    {
        $this->application->addCommands([
            new BuildCommand($this->viewFactory, $this->filesystem),
            new PostCommand($this->viewFactory, $this->filesystem)
        ]);
    }