本文整理汇总了Java中org.kohsuke.args4j.CmdLineParser.printSingleLineUsage方法的典型用法代码示例。如果您正苦于以下问题:Java CmdLineParser.printSingleLineUsage方法的具体用法?Java CmdLineParser.printSingleLineUsage怎么用?Java CmdLineParser.printSingleLineUsage使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.kohsuke.args4j.CmdLineParser
的用法示例。
在下文中一共展示了CmdLineParser.printSingleLineUsage方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: main
import org.kohsuke.args4j.CmdLineParser; //导入方法依赖的package包/类
public static void main(String[] args) throws IOException {
final MultiEntitySinkConfig config = new MultiEntitySinkConfig();
final CmdLineParser cmdLineParser = new CmdLineParser(config);
try {
cmdLineParser.parseArgument(args);
final OsmosisReader reader = new OsmosisReader(newInputStream(config.getSource()));
final MultiEntitySink sink = new MultiEntitySink(config);
sink.addObserver(new MultiEntitySinkObserver());
reader.setSink(sink);
reader.run();
} catch (CmdLineException e) {
System.out.println(e.getMessage());
System.out.print("Usage: java -jar osm-parquetizer.jar");
System.out.println();
cmdLineParser.printSingleLineUsage(System.out);
}
}
示例2: getUsage
import org.kohsuke.args4j.CmdLineParser; //导入方法依赖的package包/类
/** Returns a single-line usage string explaining how to pass the command line arguments. */
public static String getUsage() {
CommandLineArgs result = new CommandLineArgs();
CmdLineParser parser = new CmdLineParser(result);
OutputStream stream = new ByteArrayOutputStream();
parser.printSingleLineUsage(stream);
return stream.toString();
}
示例3: main
import org.kohsuke.args4j.CmdLineParser; //导入方法依赖的package包/类
public static void main(String ... args) {
VennDrawCLI vennDrawCLI = new VennDrawCLI();
CmdLineParser parser = new CmdLineParser(vennDrawCLI);
boolean showHelp = false;
if (args.length == 0) showHelp = true;
if (args.length == 1)
if (args[0].equals("-h") || args[0].equals("--help") || args[0].equals("-v") || args[0].equals("--version") || args[0].equals("-?"))
showHelp = true;
if (!showHelp) {
try {
parser.parseArgument(args);
vennDrawCLI.run();
} catch (CmdLineException e) {
e.printStackTrace();
showHelp = true;
}
}
if (showHelp) {
System.out.println("VennDraw " + VersionResolver.getVersion());
System.out.println("Git Commit: " + VersionResolver.getGitCommit());
System.out.println("Build Date: " + VersionResolver.getBuildDate());
System.out.println("\n");
System.out.print("venndraw ");
parser.printSingleLineUsage(System.out);
System.out.println();
System.out.println();
parser.printUsage(System.out);
}
}
示例4: printHelp
import org.kohsuke.args4j.CmdLineParser; //导入方法依赖的package包/类
/**
* Prints the help file for main.
* @param parser The args4j parser.
*/
private static void printHelp(CmdLineParser parser) {
System.out.print("Usage: DataSetMain ");
parser.printSingleLineUsage(System.out);
System.out.println("\n");
parser.printUsage(System.out);
System.out.println("");
return;
}
示例5: printUsage
import org.kohsuke.args4j.CmdLineParser; //导入方法依赖的package包/类
/**
* Prints the usage of main.
* @param error The error message that triggered the usage message.
* @param parser The args4j parser.
*/
private static void printUsage(String error, CmdLineParser parser) {
System.out.println(error);
System.out.print("Usage: DataSetMain ");
parser.printSingleLineUsage(System.out);
System.out.println("");
return;
}