Parses a plugin option XML definition.

@param option
The plugin option XML definition

@return The parsed plugin option
515024
private static PluginOption parsePluginOption(final Element option) {
        PluginOption po = new PluginOption();
        po.setArgName(option.attributeValue("argName"));
        po.setArgsCount(Integer.valueOf(option.attributeValue("argsCount", "1")));
        po.setArgsOptional(Boolean.valueOf(option.attributeValue("optionalArgs", "false")));
        po.setDescription(option.attributeValue("description"));
        po.setHasArgs(Boolean.parseBoolean(option.attributeValue("hasArgs", "false")));
        po.setLongOpt(option.attributeValue("longName"));
        po.setOption(option.attributeValue("shortName"));
        po.setRequired(Boolean.parseBoolean(option.attributeValue("required", "false")));
        po.setType(option.attributeValue("type"));
        po.setValueSeparator(option.attributeValue("separator"));

        return po;
    }
481963
function Plugin(option) {
    return this.each(function () {
      var $this = $(this);
      var data  = $this.data(DataKey);

      if (!data) {
        var options = $.extend({}, Default, $this.data(), typeof option == 'object' && option);
        $this.data(DataKey, (data = new ControlSidebar($this, options)));
      }

      if (typeof option == 'string') data.toggle();
    });
  }
270456
public static String getOptionValue(String[] args, String optionName) {
		String opt = "-" + optionName + "=";
		for (String arg : args) {
			if (arg.startsWith(opt))
				return arg.substring(opt.length());
		}
		return null;
	}
1082564
@SuppressWarnings("unchecked")
  private void parseOptionsFromFile(String optionFileName)
    throws ParseException {

    List<String> options = OptionsFileLoader.loadOptions(optionFileName);
    options.addAll(commandLine.getArgList());

    commandLine = cliParser.parse(cliOptions, options.toArray(new String[0]));
  }
25223
private static XmlOptions getXmlOptions() {
        if (System.getProperty("runtimeEnv") == null && System.getProperty("mdw.runtime.env") == null)
            return new XmlOptions().setSavePrettyPrint().setSavePrettyPrintIndent(2); // avoid errors when running in Designer

        String[] xmlOptionsProperties = new String[] { PropertyNames.MDW_TRANSLATOR_XMLBEANS_LOAD_OPTIONS,
                PropertyNames.MDW_TRANSLATOR_XMLBEANS_SAVE_OPTIONS };
        /**
         * First set it up with default compatibility options
         */
        xmlOptions = new XmlOptions();

        /**
         * Next get the options that the user needs from the properties file.
         */
        Class<?> xmlOptionsClass = xmlOptions.getClass();

        for (int i = 0; i < xmlOptionsProperties.length; i++) {
            String property = xmlOptionsProperties[i];
            String opt = PropertyManager.getProperty(property);
            /**
             * Only do reflection if we need to
             */
            if (opt != null && !"".equals(opt)) {
                try {
                    String[] propTable = opt.split(",");
                    for (int j = 0; j < propTable.length; j++) {
                        String prop = propTable[j];
                        String[] optTable = prop.split("=");
                        String option = optTable[0];
                        String value = null;

                        Class<?>[] classArray = new Class<?>[] { Object.class };
                        if (optTable.length > 1) {
                            // Check for int
                            value = optTable[1];
                            classArray = new Class<?>[] { Object.class, Object.class };
                            boolean gotInteger = true;
                            try {
                                Integer.parseInt(value);
                            }
                            catch (NumberFormatException e) {
                                // It's not an integer
                                gotInteger = false;
                            }

                            Method method = xmlOptionsClass.getMethod("put", classArray);
                            method.invoke(xmlOptions, new Object[] { option,
                                    gotInteger ? Integer.valueOf(value) : value });

                        }
                        else {

                            Method method = xmlOptionsClass.getMethod("put", classArray);
                            method.invoke(xmlOptions, new Object[] { option });

                        }
                    }
                }
                catch (Exception ex) {
                    // Just log it
                    logger.severeException("Unable to set XMLOption " + opt + " due to " + ex.getMessage(), ex);

                }

            }
        }
        return xmlOptions;

    }
768376
public Option getOption(String opt)
    {
        opt = Util.stripLeadingHyphens(opt);

        if (shortOpts.containsKey(opt))
        {
            return shortOpts.get(opt);
        }

        return longOpts.get(opt);
    }
594276
public String getValue(Option option) {
        if (option == null) {
            return null;
        }
        String[] values = getValues(option);
        return (values == null ? null : values[0]);
    }
1290126
public int parseArgument(Options opt, String[] args, int start)
			throws BadCommandLineException, IOException {

		int consumed = 0;
		final String optionPrefix = "-" + getOptionName() + "-";
		final int optionPrefixLength = optionPrefix.length();

		final String arg = args[start];
		final int equalsPosition = arg.indexOf('=');

		if (arg.startsWith(optionPrefix) && equalsPosition > optionPrefixLength) {
			final String propertyName = arg.substring(optionPrefixLength,
					equalsPosition);

			final String value = arg.substring(equalsPosition + 1);
			consumed++;
			try {
				BeanUtils.setProperty(this, propertyName, value);
			} catch (Exception ex) {
				ex.printStackTrace();
				throw new BadCommandLineException("Error setting property ["
						+ propertyName + "], value [" + value + "].");
			}
		}
		return consumed;
	}
814487
function parseOptions(options) {
    const defaults = {
        singleline: 1,
        multiline: 1,
        allowFirstLine: false,
    }

    if (options) {
        if (options.singleline) {
            if (typeof options.singleline === "number") {
                defaults.singleline = options.singleline
            } else if (options.singleline.max) {
                defaults.singleline = options.singleline.max
            }
        }

        if (options.multiline) {
            if (typeof options.multiline === "number") {
                defaults.multiline = options.multiline
            } else {
                if (options.multiline.max) {
                    defaults.multiline = options.multiline.max
                }

                if (options.multiline.allowFirstLine) {
                    defaults.allowFirstLine = options.multiline.allowFirstLine
                }
            }
        }
    }

    return defaults
}
319610
private function _parseOptions(SimpleXMLElement $options)
    {
        $array = array();

        /* @var $option SimpleXMLElement */
        foreach ($options as $option) {
            if ($option->count()) {
                $value = $this->_parseOptions($option->children());
            } else {
                $value = (string) $option;
            }

            $attr = $option->attributes();

            if (isset($attr->name)) {
                $array[(string) $attr->name] = $value;
            } else {
                $array[] = $value;
            }
        }

        return $array;
    }
882461
function Plugin(option) {
			return this.each(function () {
				var $this = $(this);
				var data = $this.data("bs.dropdown");

				if (!data) $this.data("bs.dropdown", (data = new Dropdown(this)));
				if (typeof option == "string") data[option].call($this);
			});
		}
1169931
public void appendOption(String... option) {
        options = Arrays.copyOf(options, options.length + 1);
        options[options.length - 1] = option;
    }
1102010
public function getPluginOption($plugin, $option = null)
    {
        $option = $option ? '.'.$option : '';

        return $this->config->get('plugins.config.'.$plugin.$option);
    }
410546
function Plugin(option) {
    return this.each(function () {
      var $this = $(this);
      var data  = $this.data(DataKey);

      if (!data) {
        $this.data(DataKey, (data = new DirectChat($this)));
      }

      if (typeof option == 'string') data.toggle($this);
    });
  }
148432
private <T> Option<T> getOption(String parameter) {
        try {
            Field field = UndertowOptions.class.getDeclaredField(parameter);
            if (Option.class.getName().equals(field.getType().getTypeName())) {
                Object value = field.get(null);
                return (Option<T>) value;
            }
        } catch (Exception e) {
            log.debug("getting Option type for parameter {} failed with {}", parameter, e);
        }
        return null;
    }
827937
private String parameter(Options opt, Parameter p[]) {
	StringBuilder par = new StringBuilder(1000);
	for (int i = 0; i < p.length; i++) {
	    par.append(p[i].name() + typeAnnotation(opt, p[i].type()));
	    if (i + 1 < p.length)
		par.append(", ");
	}
	return par.toString();
    }
987816
public XMLNode parseXML(String root) {
        if (xmlElementsMap.containsKey(root)) {
            return xmlElementsMap.get(root);
        }
        try {
            currentRoot = root;
            isParsing = false;
            SAXParserFactory factory = SAXParserFactory.newInstance();
            SAXParser saxParser = factory.newSAXParser();
            InputStream in = configuration.getBuilderXML();
            saxParser.parse(in, this);
            return xmlElementsMap.get(root);
        } catch (Throwable t) {
            t.printStackTrace();
            throw new DocletAbortException(t);
        }
    }