Sets the required argument.

@param Option $option the option to set to
@param mixed  $arg    the argument

@throws CommandException if argument is missing
548488
public static function setRequiredValue( Option &$option, $arg )
    {
        if ( self::isShortCode( $arg ) || self::isLongCode( $arg ) )
        {
            throw new CommandException( 'Missing argument for option --' . $option->longCode );
        }
        else
        {
            if ( is_string( $arg ) )
            {
                $arg = trim( $arg );
            }
            
            $option->value = $arg;
        }
    }
793069
private function setOptionValue(Option $Option, $value) {
        $Option->setValue($value);
        $long = $Option->getLong();
        if (isset($this->events[$long])) {
            $Handler = $this->events[$long];
            $Handler($long, $value);
        }
    }
975325
private void checkOneArg(List<String> args, int index) throws OptionException {
        if ((index + 1) >= args.size() || args.get(index + 1).startsWith("-d")) {
            String text = messager.getText("main.requires_argument", args.get(index));
            throw new OptionException(CMDERR, this::usage, text);
        }
    }
1287184
public function setOption($option = [])
    {
        $op = $option[$this->channel];
        $op['sandbox'] = isset($option['sandbox']) ? $option['sandbox'] : 0;
        $this->provider->setOption($op);
    }
488794
public static function set($option, $value)
    {
        if (!array_key_exists($option, self::$conf))
        {
            throw new InvalidArgumentException(sprintf('Unknown option "%s"', $option));
        }

        $expected = gettype(self::$conf[$option]);
        $actual = gettype($value);
        if ($expected != $actual)
        {
            throw new InvalidArgumentException(
                sprintf('Option "%s" has type "%s", but "%s" given',
                    $option, $expected, $actual)
            );
        }

        self::$conf[$option] = $value;
    }
156001
public void addOption(String option, String argumentDesc, String description) {
        optionList.add(option);
        optionDescriptionMap.put(option, description);
        requiresArgumentSet.add(option);
        argumentDescriptionMap.put(option, argumentDesc);

        int width = option.length() + 3 + argumentDesc.length();
        if (width > maxWidth) {
            maxWidth = width;
        }
    }
736959
public function addOption($option)
    {
        $options = $this->getOptions();
        array_push($options, $option);
        $this->setOptions($options);
    }
1204346
public function unsetOption($option)
    {
        if (!isset(static::$availableOptions[$option])) {
            throw new \InvalidArgumentException(sprintf(
                'Invalid option specified: "%s". Expected one of (%s)',
                $option,
                implode(', ', array_keys(static::$availableOptions))
            ));
        }
        $pos = array_search(static::$availableOptions[$option], $this->options, true);
        if (false !== $pos) {
            unset($this->options[$pos]);
        }
    }
117494
public function setCommandOptions(array $options)
    {
        foreach ($options as $name => $option) {
            if ((!$option instanceof Parameter\Option)) {
                throw new \Parable\Console\Exception(
                    "Options must be instances of Parameter\\Option. {$name} is not."
                );
            }
            $this->commandOptions[$option->getName()] = $option;
        }
        return $this;
    }
855097
public function setOption($option, $value) {
        //Silence it because errors handled differently
        $res = @curl_setopt($this->handler, $option, $value);

        if($res === TRUE) {
            return $this;
        }

        throw new RuntimeException('Failed to set the following option: ' . $option);
    }
1055651
public function setOptions($options)
    {
        if (!is_array($options)) {
            throw new Exception\InvalidArgumentException(sprintf(
                '[%s] expects array; received [%s]',
                __METHOD__,
                gettype($options)
            ));
        }

        $this->options = $options;
    }
755047
public function addOption($option, $value = null)
    {
        if (is_array($option)) {
            $this->options = $option + $this->options;
        } else {
            $this->options[$option] = $value;
        }
    }
41420
public function setOption($option, $value = null)
    {
        if (is_array($option)) {
            $this->options += $option;
        } else {
            $this->options[$option] = $value;
        }

        return $this;
    }
1015587
public function setArguments($arguments = [])
    {
        $this->arguments = [];
        $this->requiredCount = 0;
        $this->hasOptional = false;
        $this->hasAnArrayArgument = false;
        $this->addArguments($arguments);
    }
106026
public function setOptions($options) 
	{
		foreach ($this->options as $key => $option) {
			if (isset($options[$key])) {
				$this->options[$key] = $options[$key];
			}
		}
	}
497179
public function setOption($option, $value)
    {
        if (!$this->isValidOption($option)) {
            throw new InvalidOptionException(sprintf("Invalid encoder option '%s'", $option));
        }

        $this->options[$option] = $value;
    }
731248
function addArgument($name, $options = array())
    {
        $arg = new Argument($name, $options);
        $this->args[] = $arg;

        return $this;
    }