Package org.kohsuke.args4j

Examples of org.kohsuke.args4j.CmdLineParser.parseArgument()


public class Main {
    public static void main(String[] args) throws Exception {
        XTestOptions opts = new XTestOptions();
        CmdLineParser parser = new CmdLineParser(opts);
        try {
            parser.parseArgument(args);
        } catch (Exception e) {
            parser.printUsage(System.err);
            return;
        }
View Full Code Here


        final CmdLineOptions opts = new CmdLineOptions();
        CmdLineParser parser = new CmdLineParser(opts);

        // parse command line options, give error message if no arguments passed
        try {
            parser.parseArgument(args);
        } catch (Exception e) {
            parser.printUsage(System.err);
            return;
        }
        if (opts.arguments.isEmpty()) {
View Full Code Here

    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()) {
View Full Code Here

  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;
View Full Code Here

        // this.line = line;

        CmdLineParser parser = new CmdLineParser(this);

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

    public int runCommand() {
        int exitCode = 0;
View Full Code Here

    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);
    }

    @Override
    public void setInputStream(InputStream stdin) {
        cmdlet.stdin = stdin;
View Full Code Here

//    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

   * @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

TOP
Copyright © 2018 www.massapi.com. 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.