本文整理了Java中net.sourceforge.argparse4j.inf.ArgumentParser.addMutuallyExclusiveGroup()
方法的一些代码示例,展示了ArgumentParser.addMutuallyExclusiveGroup()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ArgumentParser.addMutuallyExclusiveGroup()
方法的具体详情如下:
包路径:net.sourceforge.argparse4j.inf.ArgumentParser
类名称:ArgumentParser
方法名:addMutuallyExclusiveGroup
[英]Creates new mutually exclusive group, MutuallyExclusiveGroupobject, without title and adds to this parser and returns the object.
[中]创建新的互斥组MutuallyExclusiveGroupobject,不带标题,并添加到此解析器并返回该对象。
代码示例来源:origin: AsamK/signal-cli
.help("Set the path, where to store the config (Default: $XDG_DATA_HOME/signal-cli , $HOME/.local/share/signal-cli).");
MutuallyExclusiveGroup mut = parser.addMutuallyExclusiveGroup();
mut.addArgument("-u", "--username")
.help("Specify your phone number, that will be used for verification.");
代码示例来源:origin: GoogleCloudPlatform/java-docs-samples
public static void main(String... args) throws Exception {
ArgumentParser parser = ArgumentParsers.newFor("SynthesizeFile").build()
.defaultHelp(true)
.description("Synthesize a text file or ssml file.");
MutuallyExclusiveGroup group = parser.addMutuallyExclusiveGroup().required(true);
group.addArgument("--text").help("The text file from which to synthesize speech.");
group.addArgument("--ssml").help("The ssml file from which to synthesize speech.");
try {
Namespace namespace = parser.parseArgs(args);
if (namespace.get("text") != null) {
synthesizeTextFile(namespace.getString("text"));
} else {
synthesizeSsmlFile(namespace.getString("ssml"));
}
} catch (ArgumentParserException e) {
parser.handleError(e);
}
}
}
代码示例来源:origin: GoogleCloudPlatform/java-docs-samples
public static void main(String... args) throws Exception {
ArgumentParser parser =
ArgumentParsers.newFor("SynthesizeText")
.build()
.defaultHelp(true)
.description("Synthesize a text or ssml.");
MutuallyExclusiveGroup group = parser.addMutuallyExclusiveGroup().required(true);
group.addArgument("--text").help("The text file from which to synthesize speech.");
group.addArgument("--ssml").help("The ssml file from which to synthesize speech.");
try {
Namespace namespace = parser.parseArgs(args);
if (namespace.get("text") != null) {
synthesizeText(namespace.getString("text"));
} else {
synthesizeSsml(namespace.getString("ssml"));
}
} catch (ArgumentParserException e) {
parser.handleError(e);
}
}
}
代码示例来源:origin: lenskit/lenskit
public static void configureArguments(ArgumentParser parser, boolean required) {
MutuallyExclusiveGroup group =
parser.addMutuallyExclusiveGroup("input data")
.description("Specify the input data for the command.")
.required(required);
代码示例来源:origin: lenskit/lenskit
parser.addMutuallyExclusiveGroup("crossfold mode")
.description("Partitioning mode for the crossfolder.");
mode.addArgument("--partition-users")
parser.addMutuallyExclusiveGroup("user crossfolding options")
.description("Options controlling user-based crossfolding (--sample-users, --partition-users)");
userOpts.addArgument("--holdout-fraction")
代码示例来源:origin: bazaarvoice/jersey-hmac-auth
parser.addArgument("-d", "--data", "--data-binary").required(false).help("The data to use in a POST (or @filename for a file full of data)");
MutuallyExclusiveGroup contentTypes = parser.addMutuallyExclusiveGroup();
contentTypes.addArgument("-C", "--content-type").help("Content type to send in the Content-Type request header");
contentTypes.addArgument("-J", "--json").dest("content_type").setConst("application/json").action(storeConst()).help("Specifies application/json in the Content-Type request header");
代码示例来源:origin: io.github.jiri-meluzin/io.github.jiri-meluzin.tibcobwutils.earcomparer
.description("Takes FullConfig xml file and resolves expressions inside using global config file - used mainly for TED instances");
argParser.addArgument("-fullconfig").type(String.class).required(true).help("Path to fullconfig that should be resolved.");
MutuallyExclusiveGroup addMutuallyExclusiveGroup = argParser.addMutuallyExclusiveGroup().required(true);
addMutuallyExclusiveGroup.addArgument("-fullconfigout").type(String.class).help("Path to output file with resolved full config.");
EmptyArgumentAction onlyValidateAction = new EmptyArgumentAction();
代码示例来源:origin: neo4j/cypher-shell
.setDefault(true);
MutuallyExclusiveGroup failGroup = parser.addMutuallyExclusiveGroup();
failGroup.addArgument("--fail-fast")
.help("exit and report failure on first error when reading from file (this is the default behavior)")
代码示例来源:origin: reposense/RepoSense
.addMutuallyExclusiveGroup(PROGRAM_USAGE)
.required(false);
内容来源于网络,如有侵权,请联系作者删除!