本文整理汇总了Java中net.sourceforge.argparse4j.inf.ArgumentParser.defaultHelp方法的典型用法代码示例。如果您正苦于以下问题:Java ArgumentParser.defaultHelp方法的具体用法?Java ArgumentParser.defaultHelp怎么用?Java ArgumentParser.defaultHelp使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类net.sourceforge.argparse4j.inf.ArgumentParser
的用法示例。
在下文中一共展示了ArgumentParser.defaultHelp方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: main
import net.sourceforge.argparse4j.inf.ArgumentParser; //导入方法依赖的package包/类
public static void main(String[] args) throws Exception {
// Parse and handle arguments
ArgumentParser ap = ArgumentParsers.newArgumentParser("Distributed TPCH");
ap.defaultHelp(true);
ap.addArgument("-s", "--scale").setDefault(1.0).help("TPC H Scale (final Size in GB)").type(Double.class);
ap.addArgument("-p","--parallelism").setDefault(1).help("Parallelism for program").type(Integer.class);
ap.addArgument("-e", "--extension").setDefault(".csv").help("File extension for generated files");
ap.addArgument("-o", "--outpath").setDefault("/tmp/").help("Output directory");
Namespace ns = null;
try {
ns = ap.parseArgs(args);
} catch (ArgumentParserException e) {
ap.handleError(e);
System.exit(1);
}
final ExecutionEnvironment env = ExecutionEnvironment.getExecutionEnvironment();
env.setParallelism(ns.getInt("parallelism"));
DistributedTPCH gen = new DistributedTPCH(env);
gen.setScale(ns.getDouble("scale"));
String base = ns.getString("outpath");
String ext = ns.getString("extension");
gen.generateParts().writeAsFormattedText(base + "parts" + ext, new TpchEntityFormatter());
gen.generateLineItems().writeAsFormattedText(base + "lineitems" + ext, new TpchEntityFormatter());
gen.generateOrders().writeAsFormattedText(base + "orders" + ext, new TpchEntityFormatter());
gen.generateSuppliers().writeAsFormattedText(base + "suppliers" + ext, new TpchEntityFormatter());
gen.generatePartSuppliers().writeAsFormattedText(base + "partsuppliers" + ext, new TpchEntityFormatter());
gen.generateRegions().writeAsFormattedText(base + "regions" + ext, new TpchEntityFormatter());
gen.generateNations().writeAsFormattedText(base + "nations" + ext, new TpchEntityFormatter());
gen.generateCustomers().writeAsFormattedText(base + "customers" + ext, new TpchEntityFormatter());
env.execute("Distributed TPCH Generator, Scale = "+gen.getScale());
}
示例2: createDefaultParser
import net.sourceforge.argparse4j.inf.ArgumentParser; //导入方法依赖的package包/类
protected static ArgumentParser createDefaultParser() {
ArgumentParser parser = ArgumentParsers.newArgumentParser(command);
parser.description("ifmapcli version " + DefaultConfig.IFMAP_CLI_VERSION);
parser.defaultHelp(true);
ParserUtil.addConnectionArgumentsTo(parser);
ParserUtil.addCommonArgumentsTo(parser);
return parser;
}