If there are options with default values that were not overridden
by the parsed option string, add them to the list of known options.
195497
private function addDefaultValues()
    {
        foreach ($this->optionList as $option) {
            if ($option->getArgument()->hasDefaultValue()
                    && !isset($this->options[$option->short()])
                    && !isset($this->options[$option->long()])
            ) {
                if ($option->short()) {
                    $this->options[$option->short()] = new Value(
                        $option->getArgument()->getDefaultValue(),true);
                }
                if ($option->long()) {
                    $this->options[$option->long()] = new Value(
                        $option->getArgument()->getDefaultValue(),true);
                }
/*
                if ($option->short()) {
                    $this->addOption($option->short(), $option->getArgument()->getDefaultValue());
                }
                if ($option->long()) {
                    $this->addOption($option->long(), $option->getArgument()->getDefaultValue());
                }
*/
            }
        }
    }
1110919
private void applyDefaultValues(Map<String, Object> parameterValues) {
    for (Parameter<?> parameter : allParameters) {
      parameterValues.put(parameter.getName(), getParameterDefaultValue(parameter));
    }
  }
874203
def p_DefaultValue_string(p):
  """"""
  p[0] = model.Value(type=model.Value.STRING, value=p[1])
1320708
def add_option(self, K=None, price=None, St=None, kind="call", pos="long"):
        """"""
        kinds = {
            "call": Call,
            "Call": Call,
            "c": Call,
            "C": Call,
            "put": Put,
            "Put": Put,
            "p": Put,
            "P": Put,
        }
        St = self.St if St is None else St
        option = kinds[kind](St=St, K=K, price=price, pos=pos)
        self.options.append(option)
1239825
def add_if_none_match(self):
        
        option = Option()
        option.number = defines.OptionRegistry.IF_NONE_MATCH.number
        option.value = None
        self.add_option(option)
587028
public DefaultCompositeOption add(final Option... _options) {
        if (_options != null) {
            this.options.addAll(Arrays.asList(_options));
        }
        return this;
    }
247738
function addDefaultOptions(options, defaultOptions) {

    _.defaults(options, defaultOptions);
    options.currentRetries = 0;
    return options;

}
857446
private List<Serializable> getSelectedValues(List<IdName> values, List<Serializable> defaultValues) {
        List<Serializable> selectedValues = new ArrayList<Serializable>();
        if (defaultValues == null) {
            return selectedValues;
        }
        for (Serializable s : defaultValues) {
            for  (IdName in : values) {
                if (s instanceof IdName) {
                    if ((in.getId() != null) && in.getId().equals( ((IdName)s).getId())) {
                        selectedValues.add(in);
                        break;
                    }
                } else if ((in.getId() != null) && in.getId().equals(s)) {
                    selectedValues.add(in);
                    break;
                }
            }
        }
        
        return selectedValues;
    }
1250687
def Add(self, value, *optional):
        
        if isinstance(value, TListItemWithOption):
            if optional:
                raise RuntimeError(
                    "option specified along with "
                    "TListItemWithOption. Specify one or the "
                    "other but not both.")
            return super(List, self).Add(value.item, value.option)
        return super(List, self).Add(value, *optional)
631784
def add_opt(self, opt, value=None):
        
        if value is None:
            self.common_options += [opt]
        else:
            self.common_options += [opt, value]
385524
def addOption(self, o):
    
    if self.hasOption(o.short):
      raise InterfaceException("Failed adding option - already have " + str(o))
    self.options.append(o)
1158827
void addOption(final String value) {
        Assert.checkNotNullParam("value", value);
        synchronized (options) {
            options.add(value);
        }
    }
24557
void setDefaults(Settings defaultSettings) {

		Assert.notNull(defaultSettings, "Missing default settings!");

		for (String key : defaultSettings.keySet()) {

			CommandOption<?> option = findBySetting(key);

			if (option == null) {
				// option not present ... check next
				continue;
			}

			Object value = defaultSettings.get(key);
			option.defaultsTo(value);
		}

	}
45507
function extendDefaultOptions(options) {
  return Object.assign({
    dir: DEFAULT_DIRECTORY,
    extensions: DEFAULT_EXTENSIONS,
    params: DEFAULT_PARAMS
  }, options);
}
1267894
def append_existing_values(schema, config):
    

    for section_name in config:
        for option_name in config[section_name]:
            option_value = config[section_name][option_name]

            # Note that we must preserve existing values, wether or not they
            # exist in the schema file!
            schema.setdefault(section_name, {}).setdefault(option_name, {})['value'] = option_value

    return schema
519353
private void replaceOptions(LinkedHashMap<String, String> options) {

        String oldValue = m_selectBox.getFormValueAsString();
        for (String additionalValue : new String[] {oldValue, m_externalValue}) {
            if (!options.containsKey(additionalValue)) {
                options.put(additionalValue, additionalValue);
            }
        }
        if (options.containsKey("")) {
            options.put(
                "",
                org.opencms.gwt.client.Messages.get().key(
                    org.opencms.gwt.client.Messages.GUI_SELECTBOX_EMPTY_SELECTION_0));
        }
        m_selectBox.setItems(options);
        m_selectBox.setFormValueAsString(oldValue);
    }
885788
def set_default(self, section, option,
                    default):
        """"""
        if not self.parser.has_option(section, option):
            self.parser.set(section, option, default)