本文整理了Java中net.sourceforge.argparse4j.inf.ArgumentParser.description()
方法的一些代码示例,展示了ArgumentParser.description()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ArgumentParser.description()
方法的具体详情如下:
包路径:net.sourceforge.argparse4j.inf.ArgumentParser
类名称:ArgumentParser
方法名:description
暂无
代码示例来源:origin: lenskit/lenskit
public void configureArguments(ArgumentParser parser) {
parser.description("Prints the LensKit version.");
}
}
代码示例来源:origin: spotify/helios
.defaultHelp(true)
.version(format("%s%nTested on Docker %s", NAME_AND_VERSION, TESTED_DOCKER_VERSION))
.description(format("%s%n%n%s%n%s", NAME_AND_VERSION, HELP_ISSUES, HELP_WIKI));
代码示例来源:origin: SeldonIO/seldon-server
public static void main(String[] args) throws Exception {
ArgumentParser parser = ArgumentParsers.newArgumentParser("PredictionsToInfluxDb")
.defaultHelp(true)
.description("Read Seldon predictions and send stats to influx db");
parser.addArgument("-t", "--topic").setDefault("Predictions").help("Kafka topic to read from");
parser.addArgument("-k", "--kafka").setDefault("localhost:9092").help("Kafka server and port");
parser.addArgument("-z", "--zookeeper").setDefault("localhost:2181").help("Zookeeper server and port");
parser.addArgument("-i", "--influxdb").setDefault("localhost:8086").help("Influxdb server and port");
parser.addArgument("-u", "--influx-user").setDefault("root").help("Influxdb user");
parser.addArgument("-p", "--influx-password").setDefault("root").help("Influxdb password");
parser.addArgument("-d", "--influx-database").setDefault("seldon").help("Influxdb database");
parser.addArgument("--influx-measurement").setDefault("predictions").help("Influxdb Predictions measurement");
Namespace ns = null;
try {
ns = parser.parseArgs(args);
PredictionsToInfluxDb.process(ns);
} catch (ArgumentParserException e) {
parser.handleError(e);
System.exit(1);
}
}
}
代码示例来源:origin: SeldonIO/seldon-server
public static void main(String[] args) throws Exception {
ArgumentParser parser = ArgumentParsers.newArgumentParser("ImpressionsToInfluxDb")
.defaultHelp(true)
.description("Read Seldon impressions and send stats to influx db");
parser.addArgument("-t", "--topic").setDefault("impressions").help("Kafka topic to read from");
parser.addArgument("-k", "--kafka").setDefault("localhost:9092").help("Kafka server and port");
parser.addArgument("-z", "--zookeeper").setDefault("localhost:2181").help("Zookeeper server and port");
parser.addArgument("-i", "--influxdb").setDefault("localhost:8086").help("Influxdb server and port");
parser.addArgument("-u", "--influx-user").setDefault("root").help("Influxdb user");
parser.addArgument("-p", "--influx-password").setDefault("root").help("Influxdb password");
parser.addArgument("-d", "--influx-database").setDefault("seldon").help("Influxdb database");
parser.addArgument("--influx-measurement-impressions").setDefault("impressions").help("Influxdb impressions measurement");
parser.addArgument("--influx-measurement-requests").setDefault("requests").help("Influxdb requests measurement");
Namespace ns = null;
try {
ns = parser.parseArgs(args);
ImpressionsToInfluxDb.process(ns);
} catch (ArgumentParserException e) {
parser.handleError(e);
System.exit(1);
}
}
代码示例来源:origin: atomix/atomix
.description("Runs the Atomix agent with the given arguments. Arbitrary configuration options may be overridden "
+ "by specifying the option path and value as an optional argument, e.g. --cluster.node.id node-1");
parser.addArgument("--member", "-m")
代码示例来源:origin: SeldonIO/seldon-server
public static void main(String[] args) throws Exception {
ArgumentParser parser = ArgumentParsers.newArgumentParser("ImpressionsToInfluxDb")
.defaultHelp(true)
.description("Read Seldon impressions and send stats to influx db");
parser.addArgument("-t", "--topic").setDefault("actions").help("Kafka topic to read from");
parser.addArgument("-c", "--client").required(true).help("Client to run item similarity");
parser.addArgument("-o", "--output-topic").required(true).help("Output topic");
parser.addArgument("-k", "--kafka").setDefault("localhost:9092").help("Kafka server and port");
parser.addArgument("-z", "--zookeeper").setDefault("localhost:2181").help("Zookeeper server and port");
parser.addArgument("-w", "--window-secs").type(Integer.class).setDefault(3600*5).help("streaming window size in secs, -1 means ignore");
parser.addArgument("-u", "--window-processed").type(Integer.class).setDefault(-1).help("streaming window size in processed count, -1 means ignore");
parser.addArgument("--output-poll-secs").type(Integer.class).setDefault(60).help("output timer polling period in secs");
parser.addArgument("--hashes").type(Integer.class).setDefault(100).help("number of hashes");
parser.addArgument("-m", "--min-activity").type(Integer.class).setDefault(200).help("min activity");
parser.addArgument("-p", "--parse-date-method").choices("json-time","json-utc","system").setDefault("json-time").help("min activity");
Namespace ns = null;
try {
ns = parser.parseArgs(args);
ItemSimilarityProcessor processor = new ItemSimilarityProcessor(ns);
processor.process(ns);
} catch (ArgumentParserException e) {
parser.handleError(e);
System.exit(1);
}
}
代码示例来源:origin: spotify/helios
.description(description);
代码示例来源:origin: lenskit/lenskit
public static void main(String[] args) {
ArgumentParser parser =
ArgumentParsers.newArgumentParser("lenskit")
.description("Work with LensKit recommenders and data.");
Logging.addLoggingGroup(parser);
代码示例来源:origin: AsamK/signal-cli
.build()
.defaultHelp(true)
.description("Commandline interface for Signal.")
.version(BaseConfig.PROJECT_NAME + " " + BaseConfig.PROJECT_VERSION);
代码示例来源:origin: lenskit/lenskit
public void configureArguments(ArgumentParser parser) {
parser.description("Trains a recommendation model and write it to disk.");
ScriptEnvironment.configureArguments(parser);
InputData.configureArguments(parser);
parser.addArgument("-o", "--output-file")
.type(File.class)
.metavar("FILE")
.setDefault("model.bin")
.help("write trained model to FILE");
parser.addArgument("config")
.type(File.class)
.nargs("+")
.metavar("CONFIG")
.help("load algorithm configuration from CONFIG");
}
代码示例来源:origin: lenskit/lenskit
@Override
public void configureArguments(ArgumentParser parser) {
parser.description("Predicts a user's rating of some items.");
InputData.configureArguments(parser);
ScriptEnvironment.configureArguments(parser);
RecommenderLoader.configureArguments(parser);
parser.addArgument("script")
.type(File.class)
.metavar("SCRIPT")
.help("run SCRIPT");
parser.addArgument("args")
.type(String.class)
.nargs("*")
.metavar("ARGS")
.help("pass ARGS to script");
}
代码示例来源: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 void configureArguments(ArgumentParser parser) {
parser.description("Generates recommendations for a user.");
InputData.configureArguments(parser);
ScriptEnvironment.configureArguments(parser);
RecommenderLoader.configureArguments(parser);
parser.addArgument("--json")
.action(Arguments.storeTrue())
.help("output in JSON instead of human-readable format");
parser.addArgument("-n", "--num-recs")
.type(Integer.class)
.setDefault(10)
.metavar("N")
.help("generate up to N recommendations per user");
parser.addArgument("users")
.type(Long.class)
.nargs("+")
.metavar("USER")
.help("recommend for USERS");
}
代码示例来源:origin: lenskit/lenskit
public void configureArguments(ArgumentParser parser) {
parser.description("Generates a visualization of a recommender configuration. " +
"This visualization is intended to be viewed with GraphViz.");
ScriptEnvironment.configureArguments(parser);
parser.addArgument("-o", "--output-file")
.type(File.class)
.metavar("FILE")
.setDefault(new File("recommender.dot"))
.help("write recommender diagram to FILE");
parser.addArgument("-t", "--output-type")
.type(OutputType.class)
.metavar("TYPE")
.setDefault(OutputType.dot)
.help("specify output format");
parser.addArgument("--domain")
.metavar("DOMAIN")
.help("specify preference domain");
parser.addArgument("--model-file")
.metavar("FILE")
.type(File.class)
.help("load saved model from FILE");
parser.addArgument("config")
.type(File.class)
.metavar("CONFIG")
.nargs("*")
.help("load algorithm configuration from file CONFIG");
}
代码示例来源:origin: linkedin/kafka-monitor
.newArgumentParser("")
.defaultHelp(true)
.description("");
代码示例来源:origin: lenskit/lenskit
public void configureArguments(ArgumentParser parser) {
parser.description("Predicts a user's rating of some items.");
InputData.configureArguments(parser);
ScriptEnvironment.configureArguments(parser);
RecommenderLoader.configureArguments(parser);
parser.addArgument("-B", "--batch-pairs")
.type(File.class)
.metavar("FILE")
.help("Predict for user/item pairs in CSV FILE");
parser.addArgument("-o", "--output", "--output-csv")
.type(File.class)
.metavar("FILE")
.help("Write predictions to FILE");
parser.addArgument("-u", "--user")
.type(Long.class)
.metavar("USER")
.help("predict for USER");
parser.addArgument("items")
.type(Long.class)
.metavar("ITEM")
.nargs("*")
.help("predict for ITEMs");
}
代码示例来源:origin: lenskit/lenskit
public void configureArguments(ArgumentParser parser) {
parser.description("Generates non-personalized recommendations using optional reference items.");
InputData.configureArguments(parser);
ScriptEnvironment.configureArguments(parser);
parser.addArgument("-n", "--num-recs")
.type(Integer.class)
.setDefault(10)
.metavar("N")
.help("generate up to N recommendations");
parser.addArgument("-c", "--config-file")
.type(File.class)
.action(Arguments.append())
.metavar("FILE")
.help("use configuration from FILE");
parser.addArgument("-m", "--model-file")
.type(File.class)
.metavar("FILE")
.help("load model from FILE");
parser.addArgument("items")
.type(Long.class)
.nargs("*")
.metavar("ITEM")
.help("use ITEMS as reference for recommendation");
}
}
代码示例来源:origin: lenskit/lenskit
public void configureArguments(ArgumentParser parser) {
parser.description("Simulates a recommender over time");
ScriptEnvironment.configureArguments(parser);
InputData.configureArguments(parser, true);
parser.addArgument("-o", "--output-file")
.type(File.class)
.metavar("FILE")
.setDefault("predictions.csv")
.help("write predictions and errors to FILE");
parser.addArgument("--extended-output")
.type(File.class)
.metavar("FILE")
.setDefault("extended-output.txt")
.help("write extended output as JSON lines in FILE");
parser.addArgument("-n", "--list-size")
.type(Integer.class)
.metavar("INTEGER")
.setDefault(10)
.help("Length of recommendation lists");
parser.addArgument("-r", "--rebuild-period")
.type(Long.class)
.setDefault(86400L)
.metavar("SECONDS")
.help("Rebuild Period for next build");
parser.addArgument("config")
.type(File.class)
.metavar("CONFIG")
.nargs("?")
.help("load algorithm configuration from CONFIG");
}
代码示例来源:origin: apache/phoenix
private static Namespace parseArgs(String[] args) {
ArgumentParser parser = ArgumentParsers.newFor("Phoenix Canary Test Tool").build()
.description("Phoenix Canary Test Tool");
parser.addArgument("--hostname", "-hn").type(String.class).nargs("?").help("Hostname on "
+ "which Phoenix is running.");
parser.addArgument("--port", "-p").type(String.class).nargs("?").help("Port on " +
"which Phoenix is running.");
parser.addArgument("--constring", "-cs").type(String.class).nargs("?").help("Pass an " +
"explicit connection String to connect to Phoenix. " +
"default: jdbc:phoenix:thin:serialization=PROTOBUF;url=[hostName:port]");
parser.addArgument("--timeout", "-t").type(String.class).nargs("?").setDefault("60").help
("Maximum time for which the app should run before returning error. default:" + "" +
" 60 sec");
parser.addArgument("--testschema", "-ts").type(String.class).nargs("?").setDefault
(TEST_SCHEMA_NAME).help("Custom name for the test table. " + "default: " +
TEST_SCHEMA_NAME);
parser.addArgument("--testtable", "-tt").type(String.class).nargs("?").setDefault
(TEST_TABLE_NAME).help("Custom name for the test table." + " default: " +
TEST_TABLE_NAME);
parser.addArgument("--logsinkclass", "-lsc").type(String.class).nargs("?").setDefault
("PhoenixCanaryTool$StdOutSink").help
("Path to a Custom implementation for log sink class. default: stdout");
Namespace res = null;
try {
res = parser.parseKnownArgs(args, null);
} catch (ArgumentParserException e) {
parser.handleError(e);
}
return res;
}
内容来源于网络,如有侵权,请联系作者删除!