Update some command with extra descriptions for help.

@param TaskCommand $command
328201
public function updateCommands(TaskCommand $command)
    {
        $definition = $command->getDefinition();
        $options = $definition->getOptions();

        foreach (array_keys($options) as $name) {
            switch ($name) {
                case 'where':
                    $options['where'] = new InputOption('where', null, InputOption::VALUE_REQUIRED, 'Dump only rows selected by given WHERE condition.');
                    break;
                case 'database':
                    $options['database'] = new InputOption('database', null, InputOption::VALUE_REQUIRED, 'The local db to push to.');
                    break;
                case 'defaults-local':
                    $options['defaults-local'] = new InputOption('defaults-local', null, InputOption::VALUE_REQUIRED, 'The defaults file used fot the mysql client. <comment>(defaults to ./etc/mysql/local.cnf if exists.)</comment>');
                    break;
                case 'defaults-remote':
                    $options['defaults-remote'] = new InputOption('defaults-remote', null, InputOption::VALUE_REQUIRED, 'The defaults file used for the mysqldump. <comment>(defaults to ~/.my.cnf on remote.)</comment>');
                    break;
                case 'table':
                    $options['table'] = new InputOption('table', null, InputOption::VALUE_IS_ARRAY|InputOption::VALUE_REQUIRED, 'Dump only the given table.');
                    break;
                case 'no-drop':
                    $options['no-drop'] = new InputOption('no-drop', null, InputOption::VALUE_NONE, 'Do not drop the local database (default if a table or where option is given).');
                    break;
                case 'drop':
                    $options['drop'] = new InputOption('drop', null, InputOption::VALUE_NONE, 'Drop local database <comment>(default true, if no table or where option is given)</comment>.');
                    break;
                case 'no-local':
                    $options['no-local'] = new InputOption('no-local', null, InputOption::VALUE_NONE, 'Do not wrap the mysqldump in a ssh command.');
                    break;
                case 'local':
                    $options['local'] = new InputOption('local', 'l', InputOption::VALUE_NONE, 'Wrappes the mysqldump in a ssh command <comment>(default true)</comment>.');
                    break;
                case 'no-stdout':
                    $options['no-stdout'] = new InputOption('no-stdout', null, InputOption::VALUE_NONE, 'Will forward the mysqldump stdout to a mysqlclient local <comment>default true</comment>.');
                    break;
                case 'stdout':
                    $options['stdout'] = new InputOption('stdout', 'o', InputOption::VALUE_NONE, 'Print the mysqldump to stdout.');
                    break;
                case 'file':
                    $options['file'] = new InputOption('file', null, InputOption::VALUE_REQUIRED, 'Cat file and redirect output to mysql client.');
                    break;
                case 'no-backup':
                    $options['no-backup'] = new InputOption('no-backup', null, InputOption::VALUE_NONE, 'Do not create a backup before pushing to the remote.');
                    break;
                case 'backup':
                    $options['backup'] = new InputOption('backup', null, InputOption::VALUE_NONE, 'Create a backup from a remote before pushing <comment>(default true)</comment>.');
                    break;
            }
        }
        $definition->setOptions($options);
    }
1214226
protected function handleMainCommand(Command $command)
    {
        $command->line('Clearing settings cache...');

        $this->cache->clear();

        $command->line('Settings cache cleared!');
    }
458045
public function update(): void
	{
		$composer = $this->getComposer();

		$command = 'cd ' . $this->path . ';'
			. $composer . ' self-update 2>&1;'
			. $composer . ' update 2>&1;';
		exec($command, $output);
		foreach ($output as $str) {
			if (!empty($str)) {
				Debugger::log($str, 'composer');
			}
		}
	}
800195
public void addCommand(Command command) {
        if(command == null)
            throw new IllegalArgumentException();

        if(_frozen)
            throw new IllegalStateException();

        Command[] results = new Command[_commands.length + 1];
        System.arraycopy(_commands, 0, results, 0, _commands.length);
        results[_commands.length] = command;
        _commands = results;
    }
1122705
protected void update() {
        putValue(Action.ACTION_COMMAND_KEY, command.getActionCommand());
        CommandFaceDescriptor face = command.getFaceDescriptor();
        if (face != null) {
            face.configure(this);
        }
        setEnabled(command.isEnabled());
    }
344
public function add($command)
    {
        $tasks = $this->prepper
                    ->load(get_class($command))
                    ->describe();

        $this->library->add(['task' => $tasks, 'class' => $command]);

        return $this;
    }
1072608
public void help(String command) {

        if ("*".equalsIgnoreCase(command)) {
            m_shell.help(null);
        } else if ("help".equalsIgnoreCase(command)) {
            help();
        } else {
            m_shell.help(command);
        }
    }
1232751
final public function handle(Command $command): void
    {
        if (!$command instanceof ReceivedCommand && $this->discriminator->shouldEnqueue($command)) {
            $this->queue->send($command);

            return;
        }

        if ($command instanceof ReceivedCommand) {
            $command = $command->getOriginalCommand();
        }

        $this->wrappedCommandBus->handle($command);
    }
405730
public function addCommand(\Parable\Console\Command $command)
    {
        $command->prepare($this, $this->output, $this->input, $this->parameter);
        $this->commands[$command->getName()] = $command;
        return $this;
    }
1139095
protected function cmdRefresh() /*: void*/
    {
        /**
         * @see simplecomplex_locale_text_cli()
         */
        $container = Dependency::container();
        // Validate input. ---------------------------------------------
        $language = '';
        if (empty($this->command->arguments['language'])) {
            $this->command->inputErrors[] = !isset($this->command->arguments['language']) ?
                'Missing \'language\' argument.' : 'Empty \'language\' argument.';
        } else {
            $language = $this->command->arguments['language'];
            if (!LocaleCode::validate($language)) {
                $this->command->inputErrors[] = 'Invalid \'language\' argument.';
            }
        }
        $allow_none = !empty($this->command->options['allow-none']);
        $verbose = !empty($this->command->options['verbose']);
        // Pre-confirmation --yes/-y ignored for this command.
        if ($this->environment->riskyCommandRequireConfirm && $this->command->preConfirmed) {
            $this->command->inputErrors[] = 'Pre-confirmation \'yes\'/-y option not supported for this command,'
                . "\n" . 'unless env var PHP_LIB_SIMPLECOMPLEX_UTILS_CLI_SKIP_CONFIRM'
                . "\n" . 'or .risky_command_skip_confirm file in document root.';
        }
        if ($this->command->inputErrors) {
            foreach ($this->command->inputErrors as $msg) {
                $this->environment->echoMessage(
                    $this->environment->format($msg, 'hangingIndent'),
                    'notice'
                );
            }
            // This command's help text.
            $this->environment->echoMessage("\n" . $this->command);
            exit;
        }
        // Check if the command is doable.------------------------------
        if ($container->has('config')) {
            /** @var \SimpleComplex\Config\IniSectionedConfig $config */
            $config = $container->get('config');
        } else {
            $config_class = static::CLASS_CONFIG;
            /** @var \SimpleComplex\Config\IniSectionedConfig $config */
            $config = new $config_class('global');
        }
        $locale_text_paths = $config->get('lib_simplecomplex_locale', 'localeTextPaths');
        if (!$locale_text_paths) {
            $this->environment->echoMessage(
                'Global config misses item section[lib_simplecomplex_locale] key[localeTextPaths].',
                'warning'
            );
            exit;
        }
        if (!is_array($locale_text_paths)) {
            $this->environment->echoMessage(
                'Global config item section[lib_simplecomplex_locale] key[localeTextPaths] is not array.',
                'error'
            );
            exit;
        }
        // localeTextPaths are relative to vendor dir, unless absolute.
        $vendor_dir = Utils::getInstance()->vendorDir();
        foreach ($locale_text_paths as &$path) {
            if ($path{0} !== '/' && strpos($path, $vendor_dir . '/') !== 0) {
                $path = $vendor_dir . '/' . $path;
            }
        }
        unset($path);
        // Do it.
        $locale_text_class = static::CLASS_LOCALE_TEXT;
        /** @var LocaleText $locale_text */
        $locale_text = new $locale_text_class($language, $locale_text_paths);
        // Display command and the arg values used.---------------------
        if ($this->environment->riskyCommandRequireConfirm || !$this->command->preConfirmed) {
            $this->environment->echoMessage(
                $this->environment->format(
                    $this->environment->format($this->command->name, 'emphasize')
                    . "\n" . 'language: ' . $language,
                    'hangingIndent'
                )
            );
        }
        // Request confirmation, ignore --yes/-y pre-confirmation option;
        // unless .risky_command_skip_confirm file placed in document root.
        if ($this->environment->riskyCommandRequireConfirm) {
            if (!$this->environment->confirm(
                'Refresh that locale-text language? Type \'yes\' to continue:',
                ['yes'],
                '',
                'Aborted refreshing locale-text language.'
            )) {
                exit;
            }
        } elseif (!$this->command->preConfirmed && !$this->environment->confirm(
                'Refresh that locale-text language? Type \'yes\' or \'y\' to continue:',
                ['yes', 'y'],
                '',
                'Aborted refreshing locale-text language.'
            )) {
            exit;
        }
        // Do it.
        if (!$locale_text->refresh($allow_none, $verbose)) {
            $this->environment->echoMessage('Failed to refresh locale-text language[' . $language . '].', 'error');
        } elseif (!$this->command->silent) {
            $this->environment->echoMessage('Refreshed locale-text language[' . $language . '].', 'success');
        }
        exit;
    }
1310430
public function fireInstallingCommand(Command $command)
    {
        $this->handleMainCommand($command);

        event(new SystemWasInstalledEvent());

        $command->info('System was installed!');
    }
175473
protected function _commandRestore($command)
    {
        $entity = $this->getController()->getItem();
        $command->append(array('label' => AnTranslator::_('COM-ARTICLES-ARTICLE-REVISION-RESTORE')));
        $command->href('option=com_articles&view=revision&action=restore&id='.$entity->id)
        ->setAttribute('data-trigger', 'Submit');
    }
1209845
public function addCommand(Command $command)
    {
        if (is_string($command)) {
            $command = new $command;
        }
        $map = (new CommandMapping($this->parser))->map($command);

        CommandBag::add($map->name, [
            'object' => $command,
            'map' => $map
        ]);

        return $this;
    }
1009586
public function addConsole($command) {
        /* @var $command Command */
        $command->configure();
        $name = $command->name();
        $this->defaultCommand[ $name ] = $command;
    }
1038700
protected function registerTailCommand($command)
    {
        $this->app->singleton($command, function ($app) {
            return new Commands\TailCommand($app);
        });
    }
587785
public function handle(UpdateIncidentUpdateCommand $command)
    {
        $command->update->update($this->filter($command));

        event(new IncidentUpdateWasUpdatedEvent($this->auth->user(), $command->update));

        return $command->update;
    }
323649
protected function preUpdateArtisanCommands()
    {
        collect(config('self-update.artisan_commands.pre_update'))->every(function ($commandParams, $commandKey) {
            Artisan::call($commandKey, $commandParams['params']);
        });
    }