Resolves parsed Option Shortcuts.
@access		protected
@return		void
763537
protected function finishOptions()
	{
		foreach( $this->shortcuts as $short	=> $long )
		{
			if( !array_key_exists( $short, $this->foundOptions ) )
				continue;
			$this->foundOptions[$long]	= $this->foundOptions[$short];
			unset( $this->foundOptions[$short] );
		}
	}
846689
private function resolveHelpers()
    {

        if (count($helpers = Arr::get($this->getGeneral(), 'helpers', []))) {

            foreach ($helpers as $helper) {
                if (file_exists($helper)) {
                    include $helper;
                }
            }

        }

    }
554219
protected function _parseOptions($options)
    {
        if (!empty($options['label']) && $options['label']) {
            if (!is_array($options['label'])) {
                $options['label'] = ['text' => $options['label']];
            }
            $options['label'] = array_merge_recursive($options['label'], ['class' => 'control-label']);
        }
        return parent::_parseOptions($options);
    }
688662
public function getOptions() {
        if (is_null($this->result)) {
            $this->parse();
        }
        return $this->result[Parser::RESULT_OPTIONS];
    }
1139671
protected function resolveSettings()
    {
        $captured_settings = $this->string->captureDirectives('settings', ['singles' => true]);
        $combined_settings = $this->options->settings + $captured_settings;

        foreach ($combined_settings as &$value) {
            $this->placeVars($value);
        }

        $this->settings = new Settings($combined_settings);
    }
360753
public function getOptionParser()
    {
        $parser = parent::getOptionParser();

        return $parser->setDescription([
            'Asset Compress Shell',
            '',
            'Builds and clears assets defined in your asset_compress.ini',
            'file and in your view files.'
        ])->addSubcommand('clear', [
            'help' => 'Clears all builds defined in the ini file.'
        ])->addSubcommand('build', [
            'help' => 'Generate all builds defined in the ini files.'
        ])->addOption('force', [
            'help' => 'Force assets to rebuild. Ignores timestamp rules.',
            'short' => 'f',
            'boolean' => true
        ]);
    }
593360
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('action', [
                'short' => 'a',
                'help' => __d('eav', 'Indicates what you want to do, drop an existing column or add a new one.'),
                'default' => 'add',
                'choices' => ['add', 'drop'],
            ])
            ->addOption('name', [
                'short' => 'n',
                'help' => __d('eav', 'Name of the column to be added or dropped'),
            ])
            ->addOption('type', [
                'short' => 't',
                'help' => __d('eav', 'Type of information for the column being added.'),
                'default' => 'string',
                'choices' => EavToolbox::$types,
            ])
            ->addOption('bundle', [
                'short' => 'b',
                'help' => __d('eav', 'Indicates the column belongs to a bundle name within the table.'),
                'default' => null,
            ])
            ->addOption('searchable', [
                'short' => 's',
                'help' => __d('eav', 'Whether the column being created can be used in SQL WHERE clauses.'),
                'boolean' => true,
                'default' => true,
            ])
            ->addOption('overwrite', [
                'short' => 'o',
                'help' => __d('eav', 'Overwrite column definition if already exists. An exception will be raised when overwrite is disabled and column already exists.'),
                'boolean' => true,
            ]);

        return $parser;
    }
531157
protected function controlOptions()
    {
        $allowed = array();

        if (!empty($this->current_route['options'])) {
            foreach (array_keys($this->current_route['options']) as $options) {
                foreach (explode(',', $options) as $option) {
                    $allowed[trim(trim($option, '-'))] = true;
                }
            }
        }

        $submitted = $this->getOptions();

        if (!empty($submitted) && !array_intersect_key($submitted, $allowed)) {
            $this->errorAndExit($this->text('Unsupported command options'));
        }
    }
365915
def handle_shortcut(request, config)
      if(params = config['shortcut'][request.path])
        params.each do |key, val|
          request.params[key.to_s] = val ? val : ''
        end
        request.uri = @handler_uri
      end
    end
63531
protected function parseArguments() {
        $this->config['arguments'] = [];

        $commandFound =false;

        for ($index = 0; $index < count($this->config['args']); $index++) {
            // Ignore binary name:
            if ($index === 0) {
                continue;
            }

            $arg = $this->config['args'][$index];

            // Ignore command:
            if (array_key_exists($arg, $this->config['commands']) &&
                $commandFound === false) {
                $commandFound = true;
                continue;
            }

            // Ignore options:
            if (strpos($arg, '--') === 0) {
                foreach ($this->options as $option) {
                    if (!array_key_exists('long', $option)) {
                        continue;
                    }

                    if ('--' . $option['long'] !== $arg) {
                        continue;
                    }

                    if ($option['value'] !== self::NO_VALUE &&
                        strpos($arg, '--' . $option['long'] . '=') === 0) {
                        break;
                    } elseif ($option['value'] === self::NO_VALUE) {
                        $index += 1;
                        break;
                    } else {
                        $index += 2;
                        break;
                    }
                }
            } elseif (strpos($arg, '-') === 0) {
                foreach ($this->options as $option) {
                    if (!array_key_exists('short', $option)) {
                        continue;
                    }

                    if ('-' . $option['short'] !== $arg) {
                        continue;
                    }

                    if ($option['value'] === self::NO_VALUE) {
                        $index += 1;
                        break;
                    } else {
                        $index += 2;
                        break;
                    }
                }
            } else {
                $this->config['arguments'][] = $arg;
            }
        }

        return $this;
    }
1092286
public function resolve()
    {
        foreach ($this->mappings as $mapping) {
            $mapping->removeConflict($this);
        }

        $this->mappings = array();
    }
963903
protected function parse()
    {
        $this->parseParam('sort');
        $this->parseParam('fields');
        $this->parseParam('limit');
        if ($this->isEloquentBuilder()) {
            $this->parseParam('with');
        }
        $this->parseFilter();
    }
52712
final private function parse_actions()
    {
        if (isset($this->actions) && \is_array($this->actions) && !empty($this->actions)) {
            $this->add_hooks($this->actions);
        }
    }
889780
protected function handleDefaultOptions()
    {
        if ($this->options->getOpt('no-colors')) {
            $this->colors->disable();
        }
        if ($this->options->getOpt('help')) {
            echo $this->options->help();
            exit(0);
        }
    }
427363
protected function askToUseCustomeOptions()
    {
        $this->options['pivot_table'] = $this->command->ask(
                                        "The {$this->text['pivot_text']} of both relation will be?",
                                        $this->defaultOptions['pivot_table']
                                    );

        $name = Str::singular($this->options['pivot_table']);
        $foreignKey = $name.'_id';

        $this->options['foreign_key'] = $this->command->ask(
                                            "The {$this->text['foreign_text']} of table {$this->text['to_table']} in the table {$this->text['pivot_table']} will be?",
                                            $foreignKey
                                        );

        $this->options['related_key'] = $this->command->ask(
                                            "The {$this->text['related_text']} of table {$this->text['table']} in the table {$this->text['pivot_table']} will be?",
                                            $this->defaultOptions['related_key']
                                        );
    }
1071642
protected function resolve()
    {
        $this->content = '';
        $this->isBinary = null;

        if (!self::$tmpCookies) {
            self::$tmpCookies = str_replace('//', '/', sys_get_temp_dir().'/embed-cookies.txt');
        }

        $connection = curl_init();

        curl_setopt_array($connection, [
            CURLOPT_RETURNTRANSFER => false,
            CURLOPT_FOLLOWLOCATION => true,
            CURLOPT_URL => $this->url,
            CURLOPT_COOKIEJAR => self::$tmpCookies,
            CURLOPT_COOKIEFILE => self::$tmpCookies,
            CURLOPT_HEADERFUNCTION => [$this, 'headerCallback'],
            CURLOPT_WRITEFUNCTION => [$this, 'writeCallback'],
        ] + $this->config);

        $result = curl_exec($connection);

        $this->result = curl_getinfo($connection) ?: [];

        if (!$result) {
            $this->result['error'] = curl_error($connection);
            $this->result['error_number'] = curl_errno($connection);
        }

        curl_close($connection);

        if (($content_type = $this->getResult('content_type'))) {
            if (strpos($content_type, ';') !== false) {
                list($mimeType, $charset) = explode(';', $content_type);

                $this->result['mime_type'] = $mimeType;

                $charset = substr(strtoupper(strstr($charset, '=')), 1);

                if (!empty($charset) && !empty($this->content) && ($charset !== 'UTF-8')) {
                    $this->content = mb_convert_encoding($this->content, 'UTF-8', $charset);
                }
            } elseif (strpos($content_type, '/') !== false) {
                $this->result['mime_type'] = $content_type;
            }
        }
    }
299723
public function parse()
    {
        $this->parser->parse($this->rawArguments);
        $this->parsed = true;
        $this->arguments = $this->parser->getArguments();
        $optionsShort = $this->parser->getOptionsShort();
        $optionsLong = $this->parser->getOptionsLong();
        $missongRequired = array();
        foreach ($this->optionDefinitions as $definition) {
            $value = $this->getOptionValue($definition);
            $short = $definition->getShort();
            $long = $definition->getLong();
            $optionsShort[$short] = $value;
            $optionsLong[$long] = $value;
            if ($definition->getRequired() && $value === null) {
                $parts = array();
                $parts[] = $short !== null ? '-' . $short : null;
                $parts[] = $long !== null ? '--' . $long : null;
                $missongRequired[] = implode('|', $parts);
            }
        }
        if (!empty($missongRequired)) {
            throw new GetoptException(
                'Missing required options: '
                . implode(', ', $missongRequired)
            );
        }
        $this->optionsShort = $optionsShort;
        $this->optionsLong = $optionsLong;
    }