GetOptionParser method.

@return \Cake\Console\ConsoleOptionParser
358203
public function getOptionParser()
    {
        $parser = parent::getOptionParser();

        $parser->addOption('bootstrap', [
                    'short' => 'b',
                    'help' => 'Will load bootstrap.php from plugin.',
                    'boolean' => true,
                    'default' => false,
                ])
                ->addOption('routes', [
                    'short' => 'r',
                    'help' => 'Will load routes.php from plugin.',
                    'boolean' => true,
                    'default' => false,
                ])
                ->addOption('autoload', [
                    'help' => 'Will autoload the plugin using CakePHP.' .
                        'Set to true if you are not using composer to autoload your plugin.',
                    'boolean' => true,
                    'default' => false,
                ])
                ->addOption('cli', [
                    'help' => 'Use the bootstrap_cli file.',
                    'boolean' => true,
                    'default' => false,
                ])
                ->addOption('no_app', [
                    'help' => 'Do not update the Application if it exist. Forces config/bootstrap.php to be updated.',
                    'boolean' => true,
                    'default' => false,
                ])
                ->addArgument('plugin', [
                    'help' => 'Name of the plugin to load.',
                ]);

        return $parser;
    }
791047
public function getOptionParser()
    {
        $parser = parent::getOptionParser();

        $parser->addOption('cli', [
                'help' => 'Use the bootstrap_cli file.',
                'boolean' => true,
                'default' => false,
            ])
            ->addOption('no_app', [
                'help' => 'Do not update the Application if it exist. Forces config/bootstrap.php to be updated.',
                'boolean' => true,
                'default' => false,
            ])
            ->addArgument('plugin', [
                'help' => 'Name of the plugin to load.',
            ]);

        return $parser;
    }
673172
protected function getOptions()
    {
        if (!$this->options) {
            $this->options = $this->default;
        }

        $options = [];
        foreach ($this->options as $value => $active)  {
            $options[] = $this->getActiveString($active).$value;
        }

        return join(" ", $options);
    }
670944
private function parseOptions()
    {
        $opts = $this->defaults;
        $opts = $this->parseYamlOptions($opts);
        $opts = $this->parseCliOptions($opts);

        return $opts;
    }
822489
public function getParser() : ParserInterface
    {
        if (null === $this->parser) {
            $patternHelper = new Parser\Helper\GetPattern($this->cache, $this->logger);
            $dataHelper = new Parser\Helper\GetData($this->cache, $this->logger, new Quoter());

            $this->parser = new Parser\Ini($patternHelper, $dataHelper, $this->formatter);
        }

        return $this->parser;
    }
448496
protected static OptionParser getParser() {
            OptionParser parser = new OptionParser();
            // help options
            AdminParserUtils.acceptsHelp(parser);
            // required options
            parser.accepts(OPT_HEAD_META_CHECK, "metadata keys to be checked")
                  .withOptionalArg()
                  .describedAs("meta-key-list")
                  .withValuesSeparatedBy(',')
                  .ofType(String.class);
            AdminParserUtils.acceptsUrl(parser);
            return parser;
        }
807286
public function getOptions()
    {
        if ($record = $this->getOwnerRecord()) {
            /** @var DataObject|CommentsExtension $record */
            return $record->getCommentsOptions();
        }

        // Otherwise a singleton of that record
        if ($class = $this->getParentClass()) {
            return singleton($class)->getCommentsOptions();
        }

        // Otherwise just use the default options
        return singleton(CommentsExtension::class)->getCommentsOptions();
    }
209239
public function getOptions() {
		$reflection = new ReflectionObject($this);
		$methods    = $reflection->getMethods(ReflectionMethod::IS_PUBLIC);
		
		$options = [];
		
		foreach ($methods as $method) {
			if ($method->getNumberOfRequiredParameters() > 0) {
				continue;
			}
			
			$name = $method->name;
			
			if (isset($name[3]) && $name !== 'getOptions' && substr($name, 0, 3) === 'get') {
				$optionName = lcfirst(substr($name, 3));
				$options[$optionName] = $method->invoke($this);
			}
		}
		
		return $options;
	}
1099542
public function getOptionParser()
    {
        $parser = parent::getOptionParser();
        $parser
            ->description(__d('installer', 'Uninstall an existing plugin.'))
            ->addOption('plugin', [
                'short' => 'p',
                'help' => __d('installer', 'Name of the plugin to uninstall.'),
            ])
            ->addOption('no-callbacks', [
                'short' => 'c',
                'help' => __d('installer', 'Plugin events will not be trigged.'),
                'boolean' => true,
                'default' => false,
            ]);

        return $parser;
    }
1067943
private function getResolver()
    {
        if ($this->resolver === null) {
            $this->resolver = new OptionsResolver();
            $this->configureOptions($this->resolver);
        }

        return $this->resolver;
    }
440590
public function getOptionParser()
    {
        $parser = parent::getOptionParser();
        $initParser = [
            'options' => [
                'plugin' => [
                    'help' => 'Plugin name.',
                    'short' => 'p'
                ],
                'force' => [
                    'help' => 'Force overwriting.',
                    'short' => 'f',
                    'boolean' => true
                ]
            ],
            'arguments' => [
                'language' => [
                    'help' => 'Two-letter language code.'
                ]
            ]
        ];

        $parser->setDescription(
            'I18n Shell generates .pot files(s) with translations.'
        )->addSubcommand('extract', [
            'help' => 'Extract the po translations from your application',
            'parser' => $this->Extract->getOptionParser()
        ])
        ->addSubcommand('init', [
            'help' => 'Init PO language file from POT file',
            'parser' => $initParser
        ]);

        return $parser;
    }
688662
public function getOptions() {
        if (is_null($this->result)) {
            $this->parse();
        }
        return $this->result[Parser::RESULT_OPTIONS];
    }
604317
protected function getOptions()
	{
		$options = array();

		/** @var \SimpleXMLElement $option */
		foreach ($this->element->children() as $option)
		{
			// Only add <option /> elements.
			if ($option->getName() != 'option')
			{
				continue;
			}

			$text = $this->translateOptions
				? $this->getText()->alt(trim((string) $option), preg_replace('/[^a-zA-Z0-9_\-]/', '_', $this->fieldname))
				: trim((string) $option);

			// Set up option elements.
			$tmp = new stdClass;
			$tmp->value = (string) $option['value'];
			$tmp->text = $text;
			$tmp->disable = ((string) $option['disabled'] == 'true');
			$tmp->class = (string) $option['class'];
			$tmp->onclick = (string) $option['onclick'];

			// Add the option object to the result set.
			$options[] = $tmp;
		}

		reset($options);

		return $options;
	}
1132000
public function getParser()
    {
        if (!$this->parser) {
            $this->setParser(Injector::inst()->get('SilverStripe\\View\\SSTemplateParser'));
        }
        return $this->parser;
    }
197550
private function parseOptions($options)
    {
        $parseResult = new \stdClass();
        $parseResult->invalidOptions = array();
        $parseResult->missingOptions = array_flip((array)$this->getRequiredOptions());

        //Doctrine parses constructor parameter into 'value' array param, restore it
        if (is_array($options) && count($options) == 1 && isset($options['value'])) {
            $options = $options['value'];
        }

        //Parse Option Array
        if (is_array($options) && count($options) > 0 && is_string(key($options))) {
            $this->parseOptionsArray($options, $parseResult);
            return $parseResult;
        }

        //Parse Single Value
        if (null !== $options && ! (is_array($options) && count($options) === 0)) {
            $this->parseSingleOption($options, $parseResult);
            return $parseResult;
        }

        return $parseResult;
    }
706614
private function generateOptions(): string
    {
        /** @var string[] $inputs */
        $inputs = [
            (string) (new VerbosityString($this->output)),
        ];

        $userDefinition = $this->console->getUserDefinition();
        // Get user arguments
        foreach ($userDefinition->getArguments() as $argument) {
            $inputs[] = Argument::toString($this->input, $argument);
        }

        // Get user options
        foreach ($userDefinition->getOptions() as $option) {
            $inputs[] = Option::toString($this->input, $option);
        }

        return implode(' ', array_filter($inputs, static function (string $item): bool {
            return $item !== '';
        }));
    }
1203838
public function getCommandOptions()
    {
        $consoleOptions = array();
        foreach ($this->requests as $name => $request) {
            if ($request->isAvailableAsCommandOption()) {
                $consoleOptions[$name] = $request->convertToCommandOption();
            }
        }

        return $consoleOptions;
    }