App::optionHelp

@return void
329518
public function optionHelp()
    {
        // Show Usage
        output()->write(
            (new Format())
                ->setContextualClass(Format::INFO)
                ->setString(language()->getLine('CLI_USAGE') . ':')
                ->setNewLinesBefore(1)
                ->setNewLinesAfter(1)
        );

        output()->write(
            (new Format())
                ->setContextualClass(Format::INFO)
                ->setString('command:action --option=value')
                ->setNewLinesAfter(2)
        );

        // Show Commanders
        $this->loadCommanders();

        if (count($this->commandersPool)) {
            output()->write(
                (new Format())
                    ->setString(language()->getLine('CLI_COMMANDS') . ':')
                    ->setNewLinesAfter(1)
            );

            $table = new Table();
            $table->isShowBorder = false;

            foreach ($this->commandersPool as $commander) {

                if ($commander instanceof AbstractCommander) {
                    $table
                        ->addRow()
                        ->addColumn($commander->getCommandName())
                        ->addColumn(language()->getLine($commander->getCommandDescription()));
                }
            }

            output()->write(
                (new Format())
                    ->setString($table->render())
                    ->setNewLinesAfter(2)
            );
        }

        // Show Options
        output()->write(
            (new Format())
                ->setString(language()->getLine('CLI_OPTIONS') . ':')
                ->setNewLinesAfter(1)
        );

        $table = new Table();
        $table->isShowBorder = false;

        $table
            ->addRow()
            ->addColumn('--version')
            ->addColumn('-v')
            ->addColumn(language()->getLine('CLI_HELP_SHOW_OPTION_VERSION'))
            ->addRow()
            ->addColumn('--help')
            ->addColumn('-h')
            ->addColumn(language()->getLine('CLI_HELP_SHOW_OPTION_HELP'))
            ->addRow()
            ->addColumn('--verbose')
            ->addColumn('-vv')
            ->addColumn(language()->getLine('CLI_HELP_SHOW_OPTION_VERBOSE'));

        output()->write(
            (new Format())
                ->setString($table->render())
                ->setNewLinesAfter(2)
        );

        exit(EXIT_SUCCESS);
    }
787580
protected function configure()
    {
        $this
            ->addOption('explain', '', InputOption::VALUE_NONE, 'Explains the commands that would be executed.')
            ->addOption('force', 'f', InputOption::VALUE_NONE, 'Force execution of otherwise skipped tasks.')
            ->addOption('plugin', '', InputOption::VALUE_REQUIRED, 'Load additional plugins on-the-fly')
            ->addOption('debug', '', InputOption::VALUE_NONE, "Set the debug flag")
        ;
    }
1046023
protected function getOptions()
    {
        return array(
          array('filename', 'F', InputOption::VALUE_OPTIONAL, 'The path to the helper file', $this->filename),
          array('dir', 'D', InputOption::VALUE_OPTIONAL | InputOption::VALUE_IS_ARRAY, 'The model dir', array()),
          array('write', 'W', InputOption::VALUE_NONE, 'Write to Model file'),
          array('nowrite', 'N', InputOption::VALUE_NONE, 'Don\'t write to Model file'),
          array('reset', 'R', InputOption::VALUE_NONE, 'Remove the original phpdocs instead of appending'),
          array('smart-reset', 'r', InputOption::VALUE_NONE, 'Refresh the properties/methods list, but keep the text'),
          array('ignore', 'I', InputOption::VALUE_OPTIONAL, 'Which models to ignore', ''),
        );
    }
466770
public function help() {
		$this->out('Inflector Shell');
		$this->out('');
		$this->out('This shell uses the Inflector class to inflect any word(s) you wish');
		$this->hr();
		$this->out('Usage: cake inflect');
		$this->out('       cake inflect methodName');
		$this->out('       cake inflect methodName word');
		$this->out('       cake inflect methodName words to inflect');
		$this->out('');
	}
197587
private function fixOptions()
    {
        $options = (is_array($this->file))
            ? $this->file
            : [[$this->file]];
        return $options;
    }
1267199
protected function setOption() {
		
		// find the value that was passed
		$updateOption = Console::findCommandOptionValue("set");
		$updateOptionBits = explode("=",$updateOption);
		if (count($updateOptionBits) == 1) {
			Console::writeError("the --set value should look like <info>optionName=\"optionValue\"</info>. nothing was updated...");
		}
		
		// set the name and value that were passed
		$updateName   = $updateOptionBits[0];
		$updateValue  = (($updateOptionBits[1][0] == "\"") || ($updateOptionBits[1][0] == "'")) ? substr($updateOptionBits[1],1,strlen($updateOptionBits[1])-1) : $updateOptionBits[1];
		
		// make sure the option being updated already exists
		$currentValue = Config::getOption($updateName);
		
		if (!$currentValue) {
			Console::writeError("the --set option you provided, <info>".$updateName."</info>, does not exists in the config. nothing will be updated...");
		} else {
			Config::updateConfigOption($updateName,$updateValue);
			Console::writeInfo("config option updated...");
		}
		
	}
792674
protected function resolveOptions(): void
    {
        $resolver = new OptionsResolver();
        $this->configureOptions($resolver);
        $this->options = $resolver->resolve($this->options);
    }
1071766
public function actionOptions()
    {
        if ($this->getContext()->getInput()->get('id')) {
            $options = $this->resourceOptions;
        } else {
            $options = $this->collectionOptions;
        }
        $this->outputOptions($options);
    }
1263128
protected static function inputHelp($help, $htmlOptions)
    {
        $type = TbArray::popValue('type', $htmlOptions, self::HELP_TYPE_INLINE);
        return $type === self::HELP_TYPE_INLINE
            ? self::help($help, $htmlOptions)
            : self::helpBlock($help, $htmlOptions);
    }
239466
private function showlist()
     {
        $this->getMessage('help');

        foreach ($this->options as $opt) {
            echo "\n";
            echo "\t \t \t", $this->log(" ".$opt['name']." => ".$opt['description']." ", 'success');
            echo "\n";
        }
     }
403992
public function checkCommandOptions()
    {
        foreach ($this->commandOptions as $option) {
            if ($option->isFlagOption()) {
                $parameters = $this->flagOptions;
            } else {
                $parameters = $this->options;
            }
            $option->addParameters($parameters);

            if ($option->isValueRequired() && $option->hasBeenProvided() && !$option->getValue()) {
                if ($option->isFlagOption()) {
                    $message = "Option '-{$option->getName()}' requires a value, which is not provided.";
                } else {
                    $message = "Option '--{$option->getName()}' requires a value, which is not provided.";
                }
                throw new \Parable\Console\Exception($message);
            }
        }
    }
886365
protected function help()
    {
        $style = new Style(' *** RUN - HELP ***');
        Out::std($style->color('fg', Style::COLOR_GREEN)->get());
        Out::std('');

        $help = new Help('...', true);
        $help->addArgument('', 'color', 'Activate colors (do not activate when redirect output in log file, colors are non-printable chars)', false, false);
        $help->addArgument('', 'debug', 'Activate debug mode (trace on exception if script is terminated with an exception)', false, false);
        $help->addArgument('', 'time-limit', 'Specified time limit in seconds (default: 0 - unlimited)', true, false);
        $help->addArgument('', 'error-reporting', 'Specified value for error-reporting (default: -1 - all)', true, false);
        $help->addArgument('', 'error-display', 'Specified value for display_errors setting. Values: 0|1 Default: 1 (display)', true, false);
        $help->addArgument('', 'quiet', 'Force disabled console lib messages (header, footer, timer...)', false, false);
        $help->addArgument('', 'name', 'Console class script to run (Example: \Eureka\Component\Database\Console', true, true);

        $help->display();
    }
540989
public function getHelp()
    {
        $msg = $this->opts->getUsageMessage();
        // Amend the auto-generated help message:
        $options = "[ options ] [ target ]\n"
            . "Where [ target ] is the name of a section of the configuration\n"
            . "specified by the ini option, or a directory to harvest into if\n"
            . "no .ini file is used. If [ target ] is omitted, all .ini sections\n"
            . "will be processed. [ options ] may be selected from those below,\n"
            . "and will override .ini settings where applicable.";
        $this->write(str_replace('[ options ]', $options, $msg));
    }
1224207
public function help()
    {
        $this->setGlobalIndent(0);
        echo $this->yellow->render('Usage:');
        echo $this('  phillip [options] [file|directory]');

        echo $this('');
        echo $this->yellow->render('Options:');
        echo $this('  -h, --help           Show help text and exit.');
        echo $this('  -v, --version        Show version information and exit.');
        echo $this('  -c, --coverage       Show coverage data.');
        echo $this('  -s, --suite <suite>  Run a predefined test suite.');
        echo $this('  -r, --random         Run tests within each suite in random order.');
    }
801922
private function handleOptionalMigrationOption()
    {
        if ($this->option('migration') === true) {
            $migrationName = 'create_' . $this->createMigrationName() . '_table';
            $this->call('module:make-migration', ['name' => $migrationName, 'module' => $this->argument('module')]);
        }
    }
63170
public function renderHelp()
    {
        echo $this->renderVersion();

        // Usage
        echo Line::begin('Usage:', Line::YELLOW)->nl();
        echo Line::begin()
            ->indent(2)
            ->text('generator [context:]subject [options]')->nl(2);

        // Options
        echo Line::begin('Options:', Line::YELLOW)->nl();
        echo Line::begin()
            ->indent(2)
            ->text('--help', Line::MAGENTA)
            ->to(21)
            ->text('-h', Line::MAGENTA)
            ->text('Display this help message.')
            ->nl(2);

        // Generators
        echo Line::begin('Available generators:', Line::YELLOW)->nl();
        foreach ($this->generators as $name => $config) {
            echo Line::begin()
                ->indent(2)
                ->text($name, Line::MAGENTA)
                ->to(24)
                ->text(Generator::create($name, $config)->getDescription())
                ->nl();
        }
    }
1044385
protected function main(Options $options)
    {

        switch ($options->getCmd()) {
            case 'foo':
                $this->success('The foo command was called');
                break;
            case 'bar':
                $this->success('The bar command was called');
                break;
            default:
                $this->error('No known command was called, we show the default help instead:');
                echo $options->help();
                exit;
        }

        $this->info('$options->getArgs():');
        var_dump($options->getArgs());

    }