Gets the option parser instance and configures it.

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

        $parser->setDescription(
            'Used by shells like bash to autocomplete command name, options and arguments'
        )->addSubcommand('commands', [
            'help' => 'Output a list of available commands',
            'parser' => [
                'description' => 'List all available',
            ]
        ])->addSubcommand('subcommands', [
            'help' => 'Output a list of available subcommands',
            'parser' => [
                'description' => 'List subcommands for a command',
                'arguments' => [
                    'command' => [
                        'help' => 'The command name',
                        'required' => false,
                    ]
                ]
            ]
        ])->addSubcommand('options', [
            'help' => 'Output a list of available options',
            'parser' => [
                'description' => 'List options',
                'arguments' => [
                    'command' => [
                        'help' => 'The command name',
                        'required' => false,
                    ],
                    'subcommand' => [
                        'help' => 'The subcommand name',
                        'required' => false,
                    ]
                ]
            ]
        ])->addSubcommand('fuzzy', [
            'help' => 'Guess autocomplete'
        ])->setEpilog([
            'This command is not intended to be called manually',
        ]);

        return $parser;
    }
670944
private function parseOptions()
    {
        $opts = $this->defaults;
        $opts = $this->parseYamlOptions($opts);
        $opts = $this->parseCliOptions($opts);

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

        return $this->resolver;
    }
529492
public function getOptionParser() {
		$file = Runner::ROBOFILE;
		if (Configure::check('Path.robofile')) {
			$file = Configure::read('Path.robofile');
		}

		$parser = new ConsoleOptionParser('robot', false);
		$parser->description(
			'This shell provides a Robo runner.' .
			"\n\n" .
			'You will need to have robo installed for this Shell to work. '
		)->addOption('config', [
			'help' => __d('cake_console', 'Path to your RoboFile class'),
			'default' => $file
		]);
		return $parser;
	}
172637
public function getOptionParser()
    {
        $parser = parent::getOptionParser();
        $parser
            ->description(__d('eav', 'Select target table'))
            ->addOption('use', [
                'short' => 'u',
                'help' => __d('eav', 'The table alias name. e.g. "User.Users".'),
            ])
            ->addOption('bundle', [
                'short' => 'b',
                'help' => __d('eav', 'Indicates the column belongs to a bundle name within the table.'),
                'default' => null,
            ]);

        return $parser;
    }
332841
public function getOptionParser()
    {
        $parser = new ConsoleOptionParser('console');
        $parser
            ->description("This shell clean the cache of your application.")
            ->command("cache.clear")
            ->addOption('all', [
                'short' => 'a',
                'help' => 'Clear all caches',
                'boolean' => true,
            ])

            ->addSubcommand('all', [
                'help' => 'Clear all caches',
            ])
            ;

        foreach ( $this->tasks as $task => $option ) {
            $classname = $this->taskClassname($task);

            $parser->addSubcommand($this->taskName($task), [
                'help' => $this->$classname->help(),
                'parser' => $this->$classname->getOptionParser(),
            ]);
        }

        return $parser;
    }
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;
	}
334218
public function getOption()
    {
        $option = new Option();
        $method = $this->getReflection();

        $comment = $method->getDocComment();
        $parser = new OptionParser();
        $lines = [];
        foreach (preg_split('/\r\n|\n|\r/', $comment) as $line) {
            // /** or */ is skip.
            if (in_array(trim($line), ['/**', '*/', '**/'])) continue;

            $line = preg_replace('/^\s*?\*\s?/', '', $line);

            // options
            if($parser->isSupports($line)) {
                $option->addDefinition($parser->parse($line));
                continue;
            }

            // start char is "@" that is doc comment end signal.
            if (preg_match('/^@\w+/', $line)) continue;

            $lines[] = $line;
        }

        if ($options = $option->getDefinitions()) {
            $lines[] = $parser->formatter($option);
        }

        $option->setDescription(join(PHP_EOL, $lines));

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

        $parser->setDescription(
            'Get the list of available shells for this CakePHP application.'
        )->addOption('xml', [
            'help' => 'Get the listing as XML.',
            'boolean' => true
        ])->addOption('version', [
            'help' => 'Prints the currently installed version of CakePHP. (deprecated - use `cake --version` instead)',
            'boolean' => true
        ]);

        return $parser;
    }
358746
protected function getOptions()
	{
		$basePath = $this->element['base_path'] ? (string) $this->element['base_path'] : JPATH_ROOT;

		// Merge any additional options in the XML definition.
		$options = array_merge(
			parent::getOptions(),
			$this->createLanguageList($this->value, $basePath)
		);

		return $options;
	}
1132000
public function getParser()
    {
        if (!$this->parser) {
            $this->setParser(Injector::inst()->get('SilverStripe\\View\\SSTemplateParser'));
        }
        return $this->parser;
    }
819131
public function getOptionParser() {
		$parser = parent::getOptionParser();
		$parser->description('There is no help');
		$taskNames = array_keys(Hash::normalize($this->tasks));
		foreach ($taskNames as $taskName) {
			$Task = $this->{$taskName};
			$parser->addSubcommand(Inflector::underscore($Task->name), array(
				'help' => $Task->getOptionParser()->description(),
				'parser' => $Task->getOptionParser()
			));
		}
		return $parser;
	}
874238
public function getOptionsForConsole()
    {
        $builder = '';

        foreach ($this->options as $option => $value) {
            $builder .= '--' . $option;

            if ($value) {
                $builder .= '=' . $value;
            }

            $builder .= ' ';
        }

        return $builder;
    }
148595
public function getParser()
    {
        if (!isset($this->parser)) {
            $this->parser = new Parser($this);
        }
        return $this->parser;
    }
295619
public function getOptionParser(): ConsoleOptionParser
    {
        return parent::getOptionParser()->addSubcommand(
            'all',
            [
                'short' => 'a',
                'help' => __('Searches and precompiles all twig templates it finds.'),
            ]
        )->addSubcommand(
            'plugin',
            [
                'short' => 'p',
                'help' => __('Searches and precompiles all twig templates for a specific plugin.'),
            ]
        )->addSubcommand(
            'file',
            [
                'short' => 'f',
                'help' => __('Precompile a specific file.'),
            ]
        )->setDescription(__('TwigView templates precompiler'));
    }
956565
public function getOptionParser() {
        $requireProject = [
            'arguments' => [
                'project' => ['help' => 'Project name (folder)', 'required' => true]
            ]
        ];

        return parent::getOptionParser()
            ->addSubCommand('all', [
                'help' => 'Same as "start" + "create" + "unseal" + "mounts"'
            ])
            ->addSubCommand('start', [
                'help' => 'Start vault'
            ])
            ->addSubCommand('stop', [
                'help' => 'Stop vault'
            ])
            ->addSubCommand('restart', [
                'help' => 'Stop vault'
            ])
            ->addSubCommand('reset', [
                'help' => 'Wipe Vault and all its configuration'
            ])
            ->addSubCommand('status', [
                'help' => 'Get the status of the Vault instance'
            ])
            ->addSubCommand('create', [
                'help' => 'Initialize Vault and store the secrets safely'
            ])
            ->addSubCommand('env', [
                'help' => join(PHP_EOL, [
                    'Export the ENV variables for using the vault CLI tool directly.',
                    'Please run: eval $(sudo bownty-cli vault env)'
                ])
            ])
            ->addSubCommand('mounts', [
                'help' => 'Create the mounts required for global operation'
            ])
            ->addSubCommand('seal', [
                'help' => 'Seal the Vault'
            ])
            ->addSubCommand('unseal', [
                'help' => 'Unseal the Vault'
            ])
            ->addSubCommand('sync_vault_key', [
                'help' => 'Sync the Vault key into Consul (used by consul-template)'
            ])
            ->addSubCommand('wait_for', [
                'help' => 'Wait for something'
            ]);
    }
1052766
public function getOptionParser()
    {
        $parser = parent::getOptionParser();

        $parser->description(
            'Bake a JS Controller for use in FrontendBridge '
        )->addArgument('controller', [
            'help' => 'Controller Name, e.g. Posts',
            'required' => true
        ])->addArgument('action', [
            'help' => 'Action Name, e.g. addPost',
            'required' => true
        ]);
        return $parser;
    }