Generates options array from passed in cli options

@return array
425088
private function getCliOptions()
    {
        $validOptions = [];

        foreach ($this->getOptions() as $option) {
            $key = $option[0];
            $validOptions[$key] = $this->option($key);
        }

        return array_filter($validOptions);
    }
965985
protected function getArguments()
    {
        $arguments = [];
       foreach ($this->getOptionArguments() as $argument) {
            if ($argument instanceof Argument) {
                $arguments[] = $this->getServiceManager()->propagate($argument);
            }
        }
        return $arguments;
    }
498396
public function toArray()
    {
        $result = [
            'command' => $this->_command,
            'arguments' => $this->_args,
            'options' => $this->_options,
            'subcommands' => $this->_subcommands,
            'description' => $this->_description,
            'epilog' => $this->_epilog
        ];

        return $result;
    }
240569
public function getOptions() {

		$options = $this->options;

		unset($options['type']);
		$options['types'] = [$this->getEntityType()];

		$filters = $this->filters;
		if (!empty($filters)) {
			foreach ($filters as $filter) {
				$name = $filter['filter'];
				$target = $filter['target'];
				$options = $this->addFilterQuery($options, $name, $target);
			}
		}

		$sorts = $this->sorts;
		if (empty($sorts)) {
			$sorts[] = [
				'field' => 'time_created',
				'direction' => 'DESC',
			];
		}

		foreach ($sorts as $sort) {
			$field = $sort['field'];
			$direction = $sort['direction'];
			$options = $this->addSortQuery($options, $field, $direction);
		}

		if ($this->search_query) {
			$options = $this->addSearchQuery($options, $this->search_query, $this->search_options);
		}

		if ($this->search_query || !empty($this->filters)) {
			if (!isset($options['no_results'])) {
				$options['no_results'] = elgg_echo('sort:search:empty');
			}
		}

		return $options;
	}
109196
public function getOptionNames()
    {
        $names = [];
        foreach ($this->options as $option) {
            $names[] = $option->getLongName();
            $names[] = $option->getShortName();
        }

        return $names;
    }
491477
public function toOptionArray()
    {
        $defaultOptions = $this->defaultOptions();
        $productCondition = $this->productFactory;
        $productAttributes = $productCondition->loadAttributeOptions()
            ->getAttributeOption();
        $pAttributes = [];
        foreach ($productAttributes as $code => $label) {
            if (strpos($code, 'quote_item_') === false) {
                $pAttributes[$code] = $label;
            }
        }
        $options = array_merge($defaultOptions, $pAttributes);

        return $options;
    }
1229891
public function toOptionArray()
    {
        $options = [];
        foreach ($this->getContainers() as $container) {
            $options[] = ['value' => $container['name'], 'label' => __($container['label'])];
        }

        return $options;
    }
773586
public function toArray()
    {
        $options = $this->options;

        if ($this->Default) {
            $options = array_merge($this->Default->options, $options);
        }

        ksort($options);

        return $options;
    }
766435
protected function getOptions()
    {
        return [
            ['dry-run', 'r', InputOption::VALUE_NONE, 'Dry run: run process but do not write anything'],
            ['editor', 'e', InputOption::VALUE_NONE, 'Open files which need to be edited at the end of the process'],
            ['force', 'f', InputOption::VALUE_NONE, 'Force files to be rewritten even if there is nothing to do'],
            ['translation', 't', InputOption::VALUE_NONE, 'Try to translate the lemma to the target language'],
            [
                'new-value',
                'l',
                InputOption::VALUE_OPTIONAL,
                'Value of new found lemmas (use %LEMMA for the lemma value or translation). Set it to null to provide translation fallbacks.',
                'TODO: %LEMMA',
            ],
            ['no-backup', 'b', InputOption::VALUE_NONE, 'Do not backup lang file (be careful, I am not a good coder)'],
            ['no-comment', 'c', InputOption::VALUE_NONE, 'Do not add comments in lang files for lemma definition'],
            ['no-date', 'd', InputOption::VALUE_NONE, 'Do not add the date of execution in the lang files'],
            ['no-obsolete', 'o', InputOption::VALUE_NONE, 'Do not write obsolete lemma (obsolete lemma will be removed)'],
            ['output-flat', 'w', InputOption::VALUE_NONE, 'Output arrays are flat (do not use sub-arrays and keep dots in lemma)'],
            ['silent', 's', InputOption::VALUE_NONE, 'Use this option to only return the exit code (use $? in shell to know whether there are missing lemma or nt)'],
            ['php-file-extension', 'x', InputOption::VALUE_OPTIONAL, 'PHP file extension', 'php'],
            ['disable-obsolete-check', 'z', InputOption::VALUE_NONE, 'Use this option to disable check for obsolete lemmas (obsolete lemma will be kept)'],
        ];
    }
220235
protected function get_options() {
        global $CFG;
        $options = parent::get_options();
        $options['file'] =  substr(__FILE__, strlen($CFG->dirroot.'/'));
        $options['context'] = $this->context;
        $options['currentgroup'] = $this->currentgroup;
        $options['forumid'] = $this->forumid;
        return $options;
    }
533870
protected function getRequestOptions()
    {
        $options = [
            'proxy' => Configuration::get('proxy')
        ];

        if (!empty(array_filter($this->multipartResources))) {
            $options['multipart'] = $this->multipartResources;
        }

        return $options;
    }
460901
public function get_options() {
		$options = array(
			'methods'  => $this->method,
			'callback' => $this->callback,
		);

		if ( $this->guard ) {
			$options['permission_callback'] = array( $this->guard, 'authorized' );
		}

		if ( $this->filter ) {
			$options['args'] = $this->filter->rules();
		}

		return $options;
	}
304268
public function _getOptions()
    {
        $opts = array();
        if (!empty($this->where))
        {
            $opts['where'] = $this->where;
        }
        if (count($this->includes))
        {
            $opts['include'] = join(',', $this->includes);
        }
        if (count($this->selectedKeys))
        {
            $opts['keys'] = join(',', $this->selectedKeys);
        }
        if ($this->limit >= 0)
        {
            $opts['limit'] = $this->limit;
        }
        if ($this->skip > 0)
        {
            $opts['skip'] = $this->skip;
        }
        if ($this->orderBy)
        {
            $opts['order'] = join(',', $this->orderBy);
        }
        if ($this->count)
        {
            $opts['count'] = $this->count;
        }

        return $opts;
    }
541622
protected function getOptions()
    {
        //shameless copy
        return [
            ['connection', 'c', InputOption::VALUE_OPTIONAL, 'The database connection to use.', $this->config->get('database.default')],
            ['tables', 't', InputOption::VALUE_OPTIONAL, 'A list of Tables you wish to Generate Migrations for separated by a comma: users,posts,comments'],
            ['path', 'p', InputOption::VALUE_OPTIONAL, 'Where should the file be created?'],
            ['namespace', 'ns', InputOption::VALUE_OPTIONAL, 'Explicitly set the namespace'],
            ['overwrite', 'o', InputOption::VALUE_NONE, 'Overwrite existing models ?'],
        ];
    }
33823
public function toOptionArray()
    {
        $option = [];
        foreach ($this->databases as $dbCode => $dbTitle) {
            $option[] = ['value' => $dbCode, 'label' => $dbTitle];
        }
        return $option;
    }
1219021
public function getOptions() {
        $options = parent::getOptions();
        if (!array_key_exists('enabled', $options)) {
            $options['enabled'] = true;
        }
        if ($options['enabled']) {
            $config = Garp_Config_Ini::getCached(APPLICATION_PATH . '/configs/acl.ini');
            $aclOptions = $config->acl->toArray();
            $options = array_merge($options, $aclOptions);
        }
        return $options;
    }
4881
protected function getOptions()
    {
        $options = array();

        foreach ($this->getModuleServices() as $module)
        {
            // Create a new option object based on the <option /> element.
            $tmp = \JHtml::_(
                'select.option', $module,
                \JText::_(trim((string) $module)), 'value', 'text'
            );

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

        reset($options);

        return $options;
    }