<p>getOptionWithShortForm.</p>

@param shortForm a {@link java.lang.String} object.
@return a {@link com.greenpepper.util.cli.Option} object.
@throws com.greenpepper.util.cli.InvalidOptionException if any.
16009
public Option getOptionWithShortForm( String shortForm ) throws InvalidOptionException
    {
        for (Option option : options)
        {
            if (shortForm.equals( option.getShortForm() )) return option;
        }

        throw new InvalidOptionException( shortForm );
    }
963307
public function get_options(&$mform) {
        global $DB;
        $none = false;

        $mform->addElement('header', 'first_header', $this->get_title());
        $mform->addHelpButton('first_header', 'criteria_' . $this->criteriatype, 'badges');

        // Get cohorts.
        $cohorts = $DB->get_records_menu('cohort', array(), 'name ASC', 'id, name');
        if (!empty($cohorts)) {
            $select = array();
            $selected = array();
            foreach ($cohorts as $cid => $cohortname) {
                $select[$cid] = format_string($cohortname, true);
            }

            if ($this->id !== 0) {
                $selected = array_keys($this->params);
            }
            $settings = array('multiple' => 'multiple', 'size' => 20, 'class' => 'selectcohort');
            $mform->addElement('select', 'cohort_cohorts', get_string('addcohort', 'badges'), $select, $settings);
            $mform->addRule('cohort_cohorts', get_string('requiredcohort', 'badges'), 'required');
            $mform->addHelpButton('cohort_cohorts', 'addcohort', 'badges');

            if ($this->id !== 0) {
                $mform->setDefault('cohort_cohorts', $selected);
            }
        } else {
            $mform->addElement('static', 'nocohorts', '', get_string('error:nocohorts', 'badges'));
            $none = true;
        }

        // Add aggregation.
        if (!$none) {
            $mform->addElement('header', 'aggregation', get_string('method', 'badges'));
            $agg = array();
            $agg[] =& $mform->createElement('radio', 'agg', '', get_string('allmethodcohort', 'badges'), 1);
            $agg[] =& $mform->createElement('radio', 'agg', '', get_string('anymethodcohort', 'badges'), 2);
            $mform->addGroup($agg, 'methodgr', '', array('<br/>'), false);
            if ($this->id !== 0) {
                $mform->setDefault('agg', $this->method);
            } else {
                $mform->setDefault('agg', BADGE_CRITERIA_AGGREGATION_ANY);
            }
        }

        return array($none, get_string('noparamstoadd', 'badges'));
    }
356749
public Option getOption(String name) {
        if (shortOpts.containsKey(name)) {
            return shortOpts.get(name);
        }
        return longOpts.get(name);
    }
783310
def form_option(str_opt):
    '''
    '''

    str_base = '#cmdoption-arg-'
    str_opt_x = str_base+str_opt.lower()\
        .replace('_', '-')\
        .replace('(', '-')\
        .replace(')', '')
    return str_opt_x
892472
public Option defaultValue(String defaultValue) throws RequiredParametersException {
		if (this.choices.isEmpty()) {
			return this.setDefaultValue(defaultValue);
		} else {
			if (this.choices.contains(defaultValue)) {
				return this.setDefaultValue(defaultValue);
			} else {
				throw new RequiredParametersException("Default value " + defaultValue +
						" is not in the list of valid values for option " + this.longName);
			}
		}
	}
704885
@Deprecated
    public Object getOptionObject(String opt)
    {
        try
        {
            return getParsedOptionValue(opt);
        }
        catch (ParseException pe)
        {
            System.err.println("Exception found converting " + opt + " to desired type: " + pe.getMessage());
            return null;
        }
    }
524828
public int getHelpPageOptions(int iOptions)
    {
    	String strPreference = this.getProperty(ThinMenuConstants.USER_HELP_DISPLAY);
    	if ((strPreference == null) || (strPreference.length() == 0))
    		strPreference = this.getProperty(ThinMenuConstants.HELP_DISPLAY);
    	if (this.getHelpView() == null)
    		if (ThinMenuConstants.HELP_PANE.equalsIgnoreCase(strPreference))
    			strPreference = null;
    	if ((strPreference == null) || (strPreference.length() == 0))
		{
    		//if (this.getAppletScreen() != null)
    		//	strPreference = MenuConstants.HELP_WEB;
    		//else if ((applet.getHelpView() != null) && (applet.getHelpView().getBaseApplet() == applet))
    			strPreference = ThinMenuConstants.HELP_PANE;
    		//else
    		//	strPreference = MenuConstants.HELP_WINDOW;
		}
		if (ThinMenuConstants.HELP_WEB.equalsIgnoreCase(strPreference))
			iOptions = ThinMenuConstants.HELP_WEB_OPTION;
		else if (ThinMenuConstants.HELP_PANE.equalsIgnoreCase(strPreference))
			iOptions = ThinMenuConstants.HELP_PANE_OPTION;
		else if (ThinMenuConstants.HELP_WINDOW.equalsIgnoreCase(strPreference))
			iOptions = ThinMenuConstants.HELP_WINDOW_OPTION;
		else
			iOptions = ThinMenuConstants.HELP_PANE_OPTION;	// Default
    	return iOptions;
    }
1309074
public alluxio.grpc.GetFileInfoPOptionsOrBuilder getOptionsOrBuilder() {
    return options_ == null ? alluxio.grpc.GetFileInfoPOptions.getDefaultInstance() : options_;
  }
1178924
public Option choices(String... choices) throws RequiredParametersException {
		if (this.defaultValue != null) {
			if (Arrays.asList(choices).contains(defaultValue)) {
				Collections.addAll(this.choices, choices);
			} else {
				throw new RequiredParametersException("Valid values for option " + this.longName +
						" do not contain defined default value " + defaultValue);
			}
		} else {
			Collections.addAll(this.choices, choices);
		}
		return this;
	}
561302
public String getOptionValue(final String optionName) {
        if (optionName.length() == 1) {
            return getOptionValue(optionName.charAt(0));
        }
        return (String) commandLine.getValue("--" + optionName);
    }
21839
public void validateOptions() throws XDocletException
    {
        super.validateOptions();

        if (getShortname() == null || getShortname().trim().equals("")) {
            throw new XDocletException(Translator.getString(XDocletMessages.class, XDocletMessages.PARAMETER_MISSING_OR_EMPTY, new String[]{"shortName"}));
        }
    }
849433
protected String getOptionalAttributeValue(StartElement start,
                                               QName attributeName) {
        Attribute mapNameAttribute = start.getAttributeByName(attributeName);
        if (mapNameAttribute == null) {
            return null;
        } else {
            return mapNameAttribute.getValue();
        }
    }
1017412
private void parseShortOptions(String arg, Iterator<String> args) throws InvalidCommandException {
    for (int i = 1; i < arg.length(); ++i) {
      String name = "-" + arg.charAt(i);
      InjectableOption injectable = injectionMap.getInjectableOption(name);

      String value;
      if (injectable.isBoolean()) {
        value = "true";
      } else {
        // We need a value. If there's anything left, we take the rest of this "short option".
        if (i + 1 < arg.length()) {
          value = arg.substring(i + 1);
          i = arg.length() - 1; // delayed "break"

        // otherwise the next arg
        } else {
          value = grabNextValue(args, name);
        }
      }
      injectNowOrLater(injectable, value);
    }
  }
1020937
@Override
  protected Object getOptionValue(Queue<String> argq) {
    String name = argq.remove();
    File file = new File(name);
    if (mustExist && !file.isFile()) {
      System.err.println("File does not exist: '" + name + "'");
      System.exit(1);
    }
    return file;
  }
367787
public String getOptionValue(String opt)
    {
        String[] values = getOptionValues(opt);

        return (values == null) ? null : values[0];
    }
885970
public static <T> Option<T> of(T t) {
    return t == null ? Option.<T>none() : some(t);
  }
1138384
public short uShortValue() throws OtpErlangRangeException {
        final long l = longValue();
        final short i = (short) l;

        if (i != l) {
            throw new OtpErlangRangeException("Value too large for short: "
                    + val);
        } else if (i < 0) {
            throw new OtpErlangRangeException("Value not positive: " + val);
        }

        return i;
    }