当前位置: 首页>>代码示例>>Java>>正文


Java CmdLineParser.printSingleLineUsage方法代码示例

本文整理汇总了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);
    }
}
 
开发者ID:adrianulbona,项目名称:osm-parquetizer,代码行数:18,代码来源:App.java

示例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();
}
 
开发者ID:grpc-ecosystem,项目名称:polyglot,代码行数:9,代码来源:CommandLineArgs.java

示例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);
    }
}
 
开发者ID:informationsea,项目名称:VennDraw,代码行数:35,代码来源:VennDrawCLI.java

示例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;
}
 
开发者ID:saltlab,项目名称:BugAID,代码行数:13,代码来源:LearningDataSetMain.java

示例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;
}
 
开发者ID:saltlab,项目名称:BugAID,代码行数:13,代码来源:LearningDataSetMain.java


注:本文中的org.kohsuke.args4j.CmdLineParser.printSingleLineUsage方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。