Adds an option instance.

@param opt the option that is to be added
@return the resulting Options instance
191698
public Options addOption(Option opt) {
        String key = opt.getKey();

        // add it to the long option list
        if (opt.hasLongName()) {
            longOpts.put(opt.getLongName(), opt);
        }

        // if the option is required add it to the required list
        if (opt.isRequired()) {
            if (requiredOpts.contains(key)) {
                requiredOpts.remove(requiredOpts.indexOf(key));
            }
            requiredOpts.add(key);
        }

        shortOpts.put(key, opt);
        return this;
    }
914597
public function addOption(OptionInterface $option)
    {
        if (!$this->hasOption($option)) {
            $this->options->add($option);
        }

        return $this;
    }
763687
@TimerJ
    public TableMetadataBuilder withOptions(Map<Selector, Selector> opts) {
        options = new HashMap<Selector, Selector>(opts);
        return this;
    }
1345902
public ElementWithOptions setOptions(LinkedHashMap<String, String> options) {
        this.optionGroups.clear();
        for (Map.Entry<String, String> entry : options.entrySet()) {
            this.addOption(entry.getKey(), entry.getValue());
        }

        return this;
    }
140805
public String[] getOptionValues(String opt)
    {
        List<String> values = new ArrayList<String>();

        for (Option option : options)
        {
            if (opt.equals(option.getOpt()) || opt.equals(option.getLongOpt()))
            {
                values.addAll(option.getValuesList());
            }
        }

        return values.isEmpty() ? null : values.toArray(new String[values.size()]);
    }
1116646
private static ImmutableSet<OpenOption> addWrite(Collection<? extends OpenOption> options) {
    return options.contains(WRITE)
        ? ImmutableSet.copyOf(options)
        : ImmutableSet.<OpenOption>builder().add(WRITE).addAll(options).build();
  }
78168
public CliCommandBuilder addJavaOptions(final String... javaOpts) {
        if (javaOpts != null) {
            for (String javaOpt : javaOpts) {
                addJavaOption(javaOpt);
            }
        }
        return this;
    }
21595
public function addOption( $opt, $type ) {
        if( $type !== self::OPT_PARAM || $type !== self::OPT_SWITCH ) {
            return;
        }
        
        $this->options[(string)$opt] = $type;
    }
899464
private Option getOption(final String opt) {
        for (Object o : getOptions().getOptions()) {
            Option opto=(Option) o;
            if (opto.getOpt().equals(opt)) {
                return opto;
            }
        }
        return null;
    }
804986
function addTableOpt( $opt ) {
		if(isset($this->currentPlatform)) {
			$this->opts[$this->parent->db->databaseType] = $opt;
		}
		return $this->opts;
	}
277011
public <T> NettyChannelBuilder withOption(ChannelOption<T> option, T value) {
    channelOptions.put(option, value);
    return this;
  }
1341178
public OptionsBuilder option(String option, Object value) {
        this.options.setOption(option, value);
        return this;
    }
1314780
public void add(CommandOption option) {

		Assert.notNull(option, "Missing command line option");

		CommandOption found = find(option);
		Assert.isNull(found, "Given option: " + option + " overlaps with: " + found);

		options.add(option);
	}
287317
public function option($opt)
	{
		$args = \func_get_args();
		if ( \is_array($opt) && isset($opt[0], $this->_defaults[$opt[0]]) ){
			$this->_current_cfg[$opt[0]] = $opt[1];
		}
		else if ( isset($args[0], $args[1], $this->_defaults[$args[0]]) ){
			$this->_current_cfg[$args[0]] = $args[1];
		}
		else{
			throw new InvalidArgumentException('This configuration argument is imaginary... Sorry! :)');
		}
    return $this;
	}
1164322
public TemplateOptionsBuilder addOption(Object field, Object value) {
    additionalOptions.put(field, value);
    return this;
  }
286483
protected List<String> createOption(final String option, final Object value) {
        if (value == null){
            return new ArrayList<String>();
        }
        return Arrays.asList(option, String.valueOf(value));
    }
631784
def add_opt(self, opt, value=None):
        
        if value is None:
            self.common_options += [opt]
        else:
            self.common_options += [opt, value]