Adds OPT_S | OPT_STORE option to OptionParser, with one argument.

@param parser OptionParser to be modified
@param required Tells if this option is required or optional
551378
public static void acceptsStoreSingle(OptionParser parser) {
        parser.acceptsAll(Arrays.asList(OPT_S, OPT_STORE), "store name")
              .withRequiredArg()
              .describedAs("store-name")
              .ofType(String.class);
    }
608170
public <T> void addParser(Class<T> clazz, StringParser<T> parser) {
		parsers.put(clazz, parser);
	}
903287
def add_bool_option(self, *args, **kwargs):
        
        dest = [o for o in args if o.startswith("--")][0].replace("--", "").replace("-", "_")
        self.parser.add_option(dest=dest, action="store_true", default=False,
            help=kwargs['help'], *args)
610618
def _fill_argparser(self, parser):
        
        for key, val in self._options.items():
            add_argument(parser, key, val)
39758
def add_classdiff_optgroup(parser):
    

    g = parser.add_argument_group("Class Checking Options")

    g.add_argument("--ignore-version-up", action="store_true",
                   default=False)
    g.add_argument("--ignore-version-down", action="store_true", default=False)
    g.add_argument("--ignore-platform-up", action="store_true", default=False)
    g.add_argument("--ignore-platform-down", action="store_true",
                   default=False)
    g.add_argument("--ignore-absolute-lines", action="store_true",
                   default=False)
    g.add_argument("--ignore-relative-lines", action="store_true",
                   default=False)
    g.add_argument("--ignore-deprecated", action="store_true", default=False)
    g.add_argument("--ignore-added", action="store_true", default=False)
    g.add_argument("--ignore-pool", action="store_true", default=False)

    g.add_argument("--ignore-lines", nargs=0,
                   help="ignore relative and absolute line-number changes",
                   action=_opt_cb_ign_lines)

    g.add_argument("--ignore-platform", nargs=0,
                   help="ignore platform changes",
                   action=_opt_cb_ign_platform)

    g.add_argument("--ignore-version", nargs=0,
                   help="ignore version changes",
                   action=_opt_cb_ign_version)
1344956
public static Config loadConfig(ConfigParseOptions parseOptions,
            ConfigResolveOptions resolveOptions, Reader configReader) {
        return ConfigFactory.parseReader(configReader, parseOptions).resolve(resolveOptions);
    }
758866
protected static OptionParser getParser() {
            OptionParser parser = new OptionParser();
            // help options
            AdminParserUtils.acceptsHelp(parser);
            AdminParserUtils.acceptsUrl(parser);
            // optional options
            AdminParserUtils.acceptsConfirm(parser);
            return parser;
        }
153888
protected static OptionParser getParser() {
            OptionParser parser = new OptionParser();
            // help options
            AdminParserUtils.acceptsHelp(parser);
            // required options
            AdminParserUtils.acceptsUrl(parser);
            // optional options
            AdminParserUtils.acceptsNodeMultiple(parser); // either
                                                          // --node or
                                                          // --all-nodes
            AdminParserUtils.acceptsAllNodes(parser); // either --node or
                                                      // --all-nodes
            AdminParserUtils.acceptsConfirm(parser);
            return parser;
        }
1150963
protected AstNode or(boolean required) throws ScanException, ParseException {
		AstNode v = and(required);
		if (v == null) {
			return null;
		}
		while (true) {
			switch (token.getSymbol()) {
				case OR:
					consumeToken();
					v = createAstBinary(v, and(true), AstBinary.OR);
					break;
				case EXTENSION:
					if (getExtensionHandler(token).getExtensionPoint() == ExtensionPoint.OR) {
						v = getExtensionHandler(consumeToken()).createAstNode(v, and(true));
						break;
					}
				default:
					return v;
			}
		}
	}
1181784
def add_arguments(self, parser):
        
        group = parser.add_mutually_exclusive_group(required=True)
        group.add_argument('-d', '--downgrade', action='store_true',
                           help='downgrade the J-Link firmware')
        group.add_argument('-u', '--upgrade', action='store_true',
                           help='upgrade the J-Link firmware')
        return self.add_common_arguments(parser, False)
392212
def add_arguments(self, parser):
        
        parser.add_argument('name', nargs=1, choices=['kinetis'],
                            help='name of MCU to unlock')
        return self.add_common_arguments(parser, True)
1341587
def add_options(cls, parser):
        
        kwargs = {'action': 'store', 'default': '', 'parse_from_config': True,
                  'comma_separated_list': True}
        for num in range(cls.min_check, cls.max_check):
            parser.add_option(None, "--filename_check{}".format(num), **kwargs)
29124
private void setup (Parser parser)
    {
    if (parser == null) {
        throw new
        NullPointerException("Parser argument must not be null");
    }
    this.parser = parser;
    atts = new AttributesImpl();
    nsSupport = new NamespaceSupport();
    attAdapter = new AttributeListAdapter();
    }
972313
public static void acceptsHex(OptionParser parser) {
        parser.acceptsAll(Arrays.asList(OPT_X, OPT_HEX), "fetch key/entry by key value of hex type")
              .withRequiredArg()
              .describedAs("key-list")
              .withValuesSeparatedBy(',')
              .ofType(String.class);
    }
695079
public void setParser(Map<JsonParser.Feature, Boolean> parser) {
        if (CollectionUtils.isNotEmpty(parser)) {
            this.parser = parser;
        }
    }
782588
private void appendOption(StringBuilder sb, Option option, boolean required) {
        if (!required) {
            sb.append(OPTIONAL_BRACKET_OPEN);
        }
        if (option.getName() != null) {
            sb.append(OPTION_PREFIX).append(option.getName());
        } else {
            sb.append(LONG_OPTION_PREFIX).append(option.getLongName());
        }
        // if the Option has a value and a non blank arg name
        if (option.hasValue() && (option.getValueName() == null || !option.getValueName().isEmpty())) {
            sb.append(option.isWithEqualSign() ? '=' : LONG_OPTION_SEPARATOR);
            sb.append(ARG_BRACKET_OPEN).append(option.getValueName() != null ? option.getValueName() : getArgName()).append(ARG_BRACKET_CLOSE);
        }
        if (!required) {
            sb.append(OPTIONAL_BRACKET_CLOSE);
        }
    }
1001123
public void setIsRequired(boolean required) {
        if (! required) {
            validators.remove(REQUIRED_FIELD_VALIDATOR);
        } else if (! isRequired()) {
            validators.add(REQUIRED_FIELD_VALIDATOR);
        }
    }