本文整理匯總了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;
}