get option

@return  Samurai\Samurai\Component\Task\Option
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;
    }
484724
public function getOption($optionName, $defaultValue = null)
    {
        $option = $this->optionManager->findOneByOptionName($optionName);

        return $option ?: $defaultValue;
    }
1102413
final protected function getOptions($option = null)
    {
        if (null !== $option) {
            if (array_key_exists($option, self::$_options)) {
                return self::$_options[$option];
            } else {
                return false;
            }
        }

        return self::$_options;
    }
373846
protected function getOptions()
    {
        // General options
        $global = [
            ['parallel', 'P', InputOption::VALUE_NONE, 'Run the tasks asynchronously instead of sequentially'],
            [
                'pretend',
                'p',
                InputOption::VALUE_NONE,
                'Shows which command would execute without actually doing anything',
            ],
        ];

        // Options that override the predefined configuration
        $overrides = [
            ['on', 'C', InputOption::VALUE_REQUIRED, 'The connection(s) to execute the Task in'],
            ['stage', 'S', InputOption::VALUE_REQUIRED, 'The stage to execute the Task in'],
            ['server', null, InputOption::VALUE_REQUIRED, 'The server to execute the Task in'],
            ['branch', 'B', InputOption::VALUE_REQUIRED, 'The branch to deploy'],
            ['release', null, InputOption::VALUE_REQUIRED, 'What to tag the release as'],
        ];

        // Additional credentials passed to Rocketeer
        $credentials = [
            ['host', null, InputOption::VALUE_REQUIRED, 'The host to use if asked'],
            ['root_directory', null, InputOption::VALUE_REQUIRED, 'The root directory to use if asked'],
            ['username', null, InputOption::VALUE_REQUIRED, 'The username to use if asked'],
            ['password', null, InputOption::VALUE_REQUIRED, 'The password to use if asked'],
            ['key', null, InputOption::VALUE_REQUIRED, 'The key to use if asked'],
            ['keyphrase', null, InputOption::VALUE_REQUIRED, 'The keyphrase to use if asked'],
            ['repository', null, InputOption::VALUE_REQUIRED, 'The repository to use if asked'],
        ];

        return array_merge(
            $global,
            $overrides,
            $credentials
        );
    }
231161
public function getValue()
    {
        if (isset($this->_value)) {
            //This is a final option
            return $this->_value;
        } elseif (!empty($this->_childs)) {
            //The option value is an array
            $result = array();
            foreach ($this->_childs as $key => $value) {
                $result[$key] = $value->getValue();
            }
            return $result;
        }
        return null;
    }
1360620
protected function getOptions()
	{
		$options = array();

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

			// Set up option elements.
			$tmp = new stdClass;
			$tmp->value = (string) $option['value'];
			$tmp->text = trim((string) $option);
			$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;
	}
1151091
public function getOptions()
    {
        if (isset($this->options['id']))
            unset($this->options['id']);

        $this->registerAnimateCss();

        if (ArrayHelper::isIndexed($this->options)) {
            $str = '';
            foreach ($this->options as $value) {
                $str .= '"' . $value . '",';
            }
            return chop($str, ' ,');
        }
        return Json::encode($this->options);
    }
336425
protected function getClientOptions()
    {
        $options = $this->clientOptions;
        $options['core']['multiple'] = $this->multiple;

        if ($this->items !== null)
            $options['core']['data'] = $this->items;

        return $options;
    }
1025309
public function getOption($name = '')
    {
        if ('' === $name) {
            return $this->option;
        }

        return isset($this->option[$name]) ? $this->option[$name] : null;
    }
731167
protected function getWorkOptions()
    {
        return new Structure(
            [
                'once' => $this->getOption('once'),
                'delay' => $this->getOption('delay'),
                'force' => $this->getOption('force'),
                'memory' => $this->getOption('memory'),
                'sleep' => $this->getOption('sleep'),
                'tries' => $this->getOption('tries'),
                'timeout' => $this->getOption('timeout'),
                'restart_signal' => $file = $this->console->get('path.temp') . '/queue/restart',
            ]
        );
    }
69316
public function toOptionArray()
    {
        if ($this->options !== null) {
            return $this->options;
        }

        $this->generateCurrentOptions();

        $this->options = array_values($this->currentOptions);

        return $this->options;
    }
559889
public static function getTaskId(){
            return new SystemCall(function (Task $Task, Scheduler $Scheduler){
                //Send the taskId to yield.
                $Task->setSendValue($Task->getTaskId());
                //Re-active the Task.
                $Scheduler->schedule($Task);
            });
        }
798203
public function getOptions()
    {
        if(!$this->options){
            if (isset($this->optionsClass)) {
                $this->options = new $this->optionsClass(array());
            } else {
                $this->options = new Options(array());
            }
        }
    
        return $this->options;
    }
814498
public function getOptions()
    {
        if ($this->options) {
            return $this->options;
        }

        return $this->options = (new \FloatingPoint\Stylist\Theme\Json($this->theme->getPath()))->getJsonAttribute('options');
    }
22142
public function getOption($name, $default = null)
    {
        if (!isset($this->options[$name])) {
            if (is_callable($default)) {
                $default = call_user_func($default);
            } if ($default instanceof \Exception) {
                throw $default;
            }
            return $default;
        }
        return $this->options[$name];
    }
245645
private function getopt()
    {

        // Reset option argument
        $this->optarg = null;
        
        // Check for index validity
        if ($this->optind >= $this->argc) {
            return -1;
        }

        // Get a copy of the current option to examine
        $arg = $this->argv[$this->optind];

        if ($this->isLongOption($arg)) {
            return $this->parseLongOption($arg);
        }

        if ($this->isShortOption($arg)) {
            return $this->parseShortOption($arg);
        }

        // If it's not an option, it's an argument,
        // so we stop parsing at the first non-option string
        // and $this->optind points to the first argument

        // Default: no options found
        return -1;
    }
662192
protected function getOptions()
    {
        $options = $this->options ? $this->options->toArray() : [];

        if ($this->topic && !$this->topic->hasOnlyOneTopic()) {
            $options = array_merge($options, $this->topic->build());
        }

        return $options;
    }