Add an option for this command.

@param string     $name
@param int        $valueRequired
@param mixed|null $defaultValue
@param bool       $flagOption

@return $this
177730
public function addOption(
        $name,
        $valueRequired = Parameter::OPTION_VALUE_OPTIONAL,
        $defaultValue = null,
        $flagOption = false
    ) {
        $this->options[$name] = new \Parable\Console\Parameter\Option(
            $name,
            $valueRequired,
            $defaultValue,
            $flagOption
        );
        return $this;
    }
717555
public function setOption(string $name, string $value): void
    {
        $this->options[$name] = $value;
    }
218872
private function addLongOption($name, $value)
    {
        if (!$this->definition->hasOption($name)) {
            throw new \RuntimeException(\sprintf('The "--%s" option does not exist.', $name));
        }

        $option = $this->definition->getOption($name);

        if (null !== $value && !$option->acceptValue()) {
            throw new \RuntimeException(\sprintf('The "--%s" option does not accept a value.', $name));
        }

        if (\in_array($value, ['', null], true) && $option->acceptValue() && \count($this->parsed)) {
            // if option accepts an optional or mandatory argument
            // let's see if there is one provided
            $next = \array_shift($this->parsed);
            $nextToken = $next[0];
            if ((isset($nextToken[0]) && '-' !== $nextToken[0]) || \in_array($nextToken, ['', null], true)) {
                $value = $nextToken;
            } else {
                \array_unshift($this->parsed, $next);
            }
        }

        if (null === $value) {
            if ($option->isValueRequired()) {
                throw new \RuntimeException(\sprintf('The "--%s" option requires a value.', $name));
            }

            if (!$option->isArray() && !$option->isValueOptional()) {
                $value = true;
            }
        }

        if ($option->isArray()) {
            $this->options[$name][] = $value;
        } else {
            $this->options[$name] = $value;
        }
    }
995665
public function setOption($name, $value)
    {
        $method = 'set' . ucfirst($name);
        if (method_exists($this, $method) && $method !== __FUNCTION__) {
            return $this->$method($value);
        }

        $this->options[$name] = $value;
        return $this;
    }
1310417
public function option($name, $value = null)
    {
        $value = null === $value ? '': $value;

        $prefix = strlen($name) == 1 ? '-' : '--';
        $this->add($prefix . $name);

        if (null !== $value) {
            $this->add($value);
        }

        return $this;
    }
716989
private function addLongOption($name, $value)
    {
        if (!$this->definition->hasOption($name)) {
            throw new InvalidOptionException(sprintf('The "--%s" option does not exist.', $name));
        }

        $option = $this->definition->getOption($name);

        if (null === $value) {
            if ($option->isValueRequired()) {
                throw new InvalidOptionException(sprintf('The "--%s" option requires a value.', $name));
            }

            if (!$option->isValueOptional()) {
                $value = true;
            }
        }

        $this->options[$name] = $value;
    }
777510
protected function getOption(string $optionName, $defaultValue = null)
    {
        return $this->getOptions()->has($optionName) ? $this->getOptions()->get($optionName) : $defaultValue;
    }
1166110
public function addOptionalHeader($name, $value)
    {
        Validate::isString($name, 'name');
        Validate::isString($value, 'value');

        if (!empty($value)) {
            $this->_headers[$name] = $value;
        }
    }
610989
public function setDefaultValue($name, $value)
    {
        if (!$this->hasParameter($name)) {
            $this->setParameter($name, $value);
        }

        return $this;
    }
638645
public function setArgument($name, $mode = null, $description = '', $default = null)
    {
        $this->definition->setArgument(new Argument($name, $mode, $description, $default));

        return $this;
    }
655463
public function addOptionalQueryParameter($name, $value)
    {
        Validate::isString($name, 'name');
        Validate::isString($value, 'value');

        if (!empty($value)) {
            $this->_queryParams[$name] = $value;
        }
    }
660028
protected function _getOption( $name, $default = null )
	{
		return ( isset( $this->_options[$name] ) ? $this->_options[$name] : $default );
	}
86776
protected function setOption($name, $value, $reset = false) {
        $changed = !isset($this->options[$name]) || $this->options[$name] !== $value;

        if ($changed && $reset) {
            $this->data = null;
        }

        $this->options[$name] = $value;
        return $this;
    }
1043244
public function addParameter($name, $defaultValue, $addComment = null)
    {
        $this->logger->info("Setting parameter $name in parameters.yml");
        $this->getYamlManipulator()->addParameterToFile($this->getBaseConfigFolder().'parameters.yml', $name, $defaultValue, false);
        $this->getYamlManipulator()->addParameterToFile($this->getBaseConfigFolder().'parameters.yml.dist', $name, $defaultValue, true, $addComment);
    }
713955
public static function setOption($optionName = "", $optionValue = "") {
		
		if (empty($optionName) || empty($optionValue)) {
			return false;
		}
		
		$arrayFinder = new ArrayFinder(self::$options);
		$arrayFinder->set($optionName, $optionValue);
		self::$options = $arrayFinder->get();
		
	}
821789
public function option($name, $value) {
		$this->validateName($name);
		return $this->merge([$name => $value]);
	}
374456
public function getProbeOption($name, $defaultOption = null)
    {
        $options = $this->getConfigArrayOption('probe', array());

        if (isset($options[$name])) {
            return $options[$name];
        }

        return $defaultOption;
    }