Package org.apache.commons.cli2.commandline

Examples of org.apache.commons.cli2.commandline.Parser


      outputOpt).withOption(measureClassOpt).withOption(convergenceDeltaOpt).withOption(maxIterOpt)
        .withOption(numMapOpt).withOption(numRedOpt).withOption(doCanopyOpt).withOption(mOpt).withOption(
          vectorClassOpt).withOption(helpOpt).create();
   
    try {
      Parser parser = new Parser();
      parser.setGroup(group);
      CommandLine cmdLine = parser.parse(args);
      if (cmdLine.hasOption(helpOpt)) {
        CommandLineUtil.printHelp(group);
        return;
      }
      String input = cmdLine.getValue(inputOpt).toString();
View Full Code Here


   
    Group group = gbuilder.withName("Options").withOption(inputOpt).withOption(outputOpt).withOption(
      topicsOpt).withOption(wordsOpt).withOption(topicSmOpt).withOption(maxIterOpt).withOption(numReducOpt)
        .withOption(overwriteOutput).withOption(helpOpt).create();
    try {
      Parser parser = new Parser();
      parser.setGroup(group);
      CommandLine cmdLine = parser.parse(args);
     
      if (cmdLine.hasOption(helpOpt)) {
        CommandLineUtil.printHelp(group);
        return;
      }
View Full Code Here

    builder.reset();
    Option isHelpOption =  builder.withShortName("h").withLongName("help").withDescription("help").create();
    new PropertyOption();
    Group allOptions = new GroupBuilder().withOption(isHelpOption).withOption(execOption).withOption(fileOption).withOption(grpOption).withOption(permOption).create();

    Parser parser = new Parser();
    parser.setGroup(allOptions);
    CommandLine cmdLine = null;

    try {
      cmdLine  = parser.parse(args);

    } catch (OptionException e1) {
      printErrString(null, System.err);
      System.exit(1);
    }
View Full Code Here

    cli.addOption("program", false, "URI to application executable", "class");
    cli.addOption("reduces", false, "number of reduces", "num");
    cli.addOption("jobconf", false,
        "\"n1=v1,n2=v2,..\" Optional. Add or override a JobConf property.",
        "key=val");
    Parser parser = cli.createParser();
    try {
      CommandLine results = parser.parse(args);
      JobConf conf = new JobConf();
      if (results.hasOption("-conf")) {
        conf.addResource(new Path((String) results.getValue("-conf")));
      }
      if (results.hasOption("-input")) {
View Full Code Here

      arg.withName(name).withMinimum(1).withMaximum(1);
      optionList.withOption(arg.create());
    }

    Parser createParser() {
      Parser result = new Parser();
      result.setGroup(optionList.create());
      return result;
    }
View Full Code Here

    cli.addOption("program", false, "URI to application executable", "class");
    cli.addOption("reduces", false, "number of reduces", "num");
    cli.addOption("jobconf", false,
        "\"n1=v1,n2=v2,..\" Optional. Add or override a JobConf property.",
        "key=val");
    Parser parser = cli.createParser();
    try {
      CommandLine results = parser.parse(args);
      JobConf conf = new JobConf();
      if (results.hasOption("-conf")) {
        conf.addResource(new Path((String) results.getValue("-conf")));
      }
      if (results.hasOption("-input")) {
View Full Code Here

      arg.withName(name).withMinimum(1).withMaximum(1);
      optionList.withOption(arg.create());
    }

    Parser createParser() {
      Parser result = new Parser();
      result.setGroup(optionList.create());
      return result;
    }
View Full Code Here

   
    Group group = gbuilder.withName("Options").withOption(minSupportOpt).withOption(inputDirOpt).withOption(
      outputOpt).withOption(maxHeapSizeOpt).withOption(numGroupsOpt).withOption(methodOpt).withOption(
      encodingOpt).withOption(helpOpt).withOption(treeCacheOpt).withOption(recordSplitterOpt).create();
    try {
      Parser parser = new Parser();
      parser.setGroup(group);
      CommandLine cmdLine = parser.parse(args);
     
      if (cmdLine.hasOption(helpOpt)) {
        CommandLineUtil.printHelp(group);
        return;
      }
View Full Code Here

    Group group = gBuilder.create();

    CommandLine cmdLine;
    try {
      Parser parser = new Parser();
      parser.setGroup(group);
      parser.setHelpOption(helpOpt);
      cmdLine = parser.parse(args);

    } catch (OptionException e) {
      log.error(e.getMessage());
      CommandLineUtil.printHelpWithGenericOptions(group, e);
      return null;
View Full Code Here

        .withOption(maxDFPercentOpt).withOption(weightOpt).withOption(powerOpt).withOption(minLLROpt)
        .withOption(numReduceTasksOpt).withOption(maxNGramSizeOpt).withOption(overwriteOutput)
        .withOption(helpOpt).withOption(sequentialAccessVectorOpt).withOption(namedVectorOpt).withOption(logNormalizeOpt)
        .create();
    try {
      Parser parser = new Parser();
      parser.setGroup(group);
      parser.setHelpOption(helpOpt);
      CommandLine cmdLine = parser.parse(args);
     
      if (cmdLine.hasOption(helpOpt)) {
        CommandLineUtil.printHelp(group);
        return;
      }
View Full Code Here

TOP

Related Classes of org.apache.commons.cli2.commandline.Parser

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.