Package org.kohsuke.args4j

Examples of org.kohsuke.args4j.CmdLineParser


        this.opts = opts;
    }

    public static void main(String[] args) throws Exception {
        final CmdLineOptions opts = new CmdLineOptions();
        CmdLineParser parser = new CmdLineParser(opts);
        try {
            parser.parseArgument(args);
        } catch (Exception e) {
            parser.printUsage(System.err);
            return;
        }
        if (opts.arguments.isEmpty()) {
            parser.printUsage(System.err);
            return;
        }
        VXQuery vxq = new VXQuery(opts);
        vxq.execute();
    }
View Full Code Here


          usage = "Whether to print the graph as the interpreter visits it")
  private boolean verbose;

  public static CommandLineOptions fromCmdLineArgs(String[] args) throws CmdLineException {
    CommandLineOptions options = new CommandLineOptions();
    CmdLineParser parser = new CmdLineParser(options);
    try {
      parser.parseArgument(args);
    } catch (CmdLineException e) {
      System.err.printf("Invalid command line: %s\n\nUsage:\n", e.getMessage());
      parser.setUsageWidth(100);
      parser.printUsage(System.err);
      throw e;
    }
    return options;
  }
View Full Code Here

    }

    public void parseArguments(String line, List<String> args) throws Exception {
        // this.line = line;

        CmdLineParser parser = new CmdLineParser(this);

        String[] argsArray = args.toArray(new String[args.size()]);
        parser.parseArgument(argsArray);
    }
View Full Code Here

    public SshCommand(Cmdlet cmdlet) {
        this.cmdlet = cmdlet;
    }

    public void parseArguments(String line, List<String> args) throws Exception {
        CmdLineParser parser = new CmdLineParser(this);

        String[] argsArray = args.toArray(new String[args.size()]);
        parser.parseArgument(argsArray);
    }
View Full Code Here

            if (cmdlet != null) {
                if (!Strings.isNullOrEmpty(message)) {
                    writer.println("");
                }
                try {
                    CmdLineParser parser = new CmdLineParser(cmdlet);
                    writer.println("Usage:");

                    parser.printUsage(writer, null);
                } catch (Exception e) {
                    log.warn("Error printing usage", e);
                }
            }
        }
View Full Code Here

//    char[] str = Hex.encodeHex(data);
//    String s = new String(str);
//    log.info("s="+s);
   
    PlayOptions bean = new PlayOptions();
      CmdLineParser parser = new CmdLineParser(bean);
    try {
        parser.parseArgument(args);
    } catch( CmdLineException e ) {
        printErr(e.getMessage());
        printUsage(parser);
        System.exit(-1);
    }
View Full Code Here

  }
 
  public static void main(String[] args) throws Exception {
   
    Options options = new Options();
    CmdLineParser parser = new CmdLineParser(options);
    parser.parseArgument(args);
   
   
    List<File> trainFiles = Arrays.asList(options.inputDirectory.listFiles());
    CollectionReader collectionReader = getCollectionReader(trainFiles);
   
View Full Code Here

   
    System.out.println("Started assertion module at " + new Date());
   
    //Options options = new Options();
    resetOptions();
    CmdLineParser parser = new CmdLineParser(options);
    parser.parseArgument(args);
//    options.parseOptions(args);

    if (useEvaluationLogFile && evaluationLogFileOut == null) {
      evaluationLogFile = new File(evaluationLogFilePath);
      evaluationLogFileOut = new BufferedWriter(new FileWriter(evaluationLogFile), 32768);
View Full Code Here

   * @param args
   * @throws IOException
   * @throws UIMAException
   */
  public static void main(String[] args) throws UIMAException, IOException {
      CmdLineParser parser = new CmdLineParser(options);
      try {
        parser.parseArgument(args);
      } catch (CmdLineException e) {
        e.printStackTrace();
        System.exit(-1);
      }
     
View Full Code Here

  /**
   * @param args
   * @throws CmdLineException
   */
  public static void main(String[] args) throws UIMAException, IOException, CmdLineException {
    CmdLineParser optionParser = new CmdLineParser(options);
    optionParser.parseArgument(args);
   
    out = new PrintStream(options.outFile);
    List<File> trainFiles = Arrays.asList(options.trainDirectory.listFiles());
    if(sems == null){
      sems = new SemanticClasses(FileLocator.getAsStream("org/apache/ctakes/assertion/all_cues.txt"));
View Full Code Here

TOP

Related Classes of org.kohsuke.args4j.CmdLineParser

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.