add a new option

@param string $name
@param Option $opt
@return Option
@throws ConfigException
8233
public function addOption($name, Option $opt = null) {
        if (isset($this->configOpts[$name]) || isset($this->configArgs[$name])) {
            throw new ConfigException('option/argument already set: ' . $name);
        }

        if (is_null($opt)) {
            $opt = new Option();
        }

        $this->configOpts[$name] = $opt;
        return $opt;
    }
30007
public function create($name, $type = null, array $options = [])
    {
        return $this->formBuilder->create($name, $type, $options);
    }
240436
public Option add(String name) throws RequiredParametersException {
		if (!this.data.containsKey(name)) {
			Option option = new Option(name);
			this.data.put(name, option);
			return option;
		} else {
			throw new RequiredParametersException("Option with key " + name + " already exists.");
		}
	}
521809
public function add($name, $value)
    {
        $config = $this->option($name);
        list($key, $extra) = $this->_splitOptionName($name);

        if ($config['array']) {
            $this->_values[$key][$extra][] = $value;
        } else {
            $this->set($name, $value);
        }
        return $this->_values[$key][$extra];
    }
944928
public function offsetSet($name, $option)
	{
		$name = $option->getName();

		$aliases = $option->getAlias();

		$this->setAlias($aliases, $name);

		parent::offsetSet($name, $option);
	}
565704
public function addOption($name, $defaultValue, $necessary=false){
		$this->defValues[$name] = $defaultValue;
		if($necessary)
			$this->necessary[$name] = true;
	}
524053
public function addGroup(string $name, $controller = null, $option = null)
    {
        return $this->controller($name, $controller, $option);
    }
953220
def new_output_file_opt(self, opt, name):
        
        fil = File(name)
        self.add_output_opt(opt, fil)
        return fil
1106157
private function createOption($name, $type)
    {
        if (isset($this->mapping[$type][$name])) {
            $class = $this->mapping[$type][$name];
            $option = new $class();
        } elseif (class_exists($name)) {
            $option = new $name();
        } else {
            throw new OptionNotFoundException($name, $type);
        }

        if ($option instanceof OptionRegistryAwareInterface) {
            $option->setOptionRegistry($this);
        }

        return $option;
    }
550632
public function addOptions(array $options)
    {
        foreach ($options as $name => $defaultValue) {
            $this->addOption($name, $defaultValue);
        }

        return $this;
    }
1313404
public function withOption($name, $description, $default = '', array $choices = [])
    {
        $this->choices[$name] = $choices;

        return $this->addOption($name, null, InputOption::VALUE_OPTIONAL, $description, $default);
    }
486888
protected function createCheckbox($name, $options)
    {
        $box = new Checkbox($name, $options);
        $box->setAttribute('checked', true)
            ->setAttribute(
                'id',
                preg_replace(
                    array('~\[~', '~\]~', '~--+~', '~-$~'),
                    array('-', '', '-', ''),
                    $name
                )
            );

        return $box;
    }
128062
public function addOption($name, array $attributes)
    {
        /**
         * @var Route $route
         */
        foreach ($this->routes as $route) {
            $route->addOption($name, $attributes);
        }
    }
1204093
public function option($name, $shortcut = null, $mode = null, $description = '', $default = null)
    {
        $option = new InputOption($name, $shortcut, $mode, $description, $default);
        $this->addOption($option);

        return $this;
    }
1040197
public function choice(string $name, array $options = []): FieldTypeInterface
    {
        return (new ChoiceType($name))
            ->setLocale($this->app->getLocale())
            ->setViewFactory($this->viewFactory)
            ->setOptions($options);
    }
1246628
public function argument($name) {
        $this->validated = false;
        if (!preg_match('#^[a-zA-Z0-9\-\_]+$#', $name)) {
            throw new OptionConfigException('illegal characters in name: ' . $name);
        }
        $this->config[self::ARGUMENT] = $name;
        return $this;
    }
1168603
public function addOptions(array $options)
    {
        $existingOptions = $this->getOptions();
        $newOptions = empty($existingOptions) ? $options : array_merge((array)$existingOptions, $options);
        $this->setOptions($newOptions);
        return $this;
    }