Package org.apache.commons.cli2.commandline

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


   * @param args
   *            the args
   */
  private static void parseCommand(String[] args)
  {
    Parser parser = new Parser();

    // configure a HelpFormatter
    HelpFormatter hf = new HelpFormatter();
    DefaultOptionBuilder oBuilder = new DefaultOptionBuilder();
    ;

    // configure a parser
    Parser p = new Parser();
    p.setGroup(group);
    p.setHelpFormatter(hf);
    p.setHelpOption(oBuilder.withLongName("help").withShortName("?").create());
    cl = p.parseAndHelp(args);

    // abort application if no CommandLine was parsed
    if (cl == null)
    {
      System.exit(-1);
View Full Code Here


        inputDirOpt).withOption(outputOpt).create();
   
    //.withOption(gramSizeOpt).withOption(typeOpt)
   
    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

    Group group = gbuilder.withName("Options").withOption(helpOpt)
        .withOption(inputDirOpt).withOption(modelOpt).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

      .withOption(maxOpt)
      .withOption(fieldOpt)
      .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

        inputDirOpt).withOption(modelOpt).withOption(typeOpt).withOption(contentFieldOpt)
        .withOption(categoryFieldOpt).withOption(maxResultsOpt)
        .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

    Group group = gbuilder.withName("Options").withOption(inputFileOpt).withOption(trainingOutputOpt)
         .withOption(testOutputOpt).withOption(trainingDataSizeOpt).withOption(testDataSizeOpt).create();
   
    try {
      Parser parser = new Parser();
      parser.setGroup(group);
      CommandLine cmdLine = parser.parse(args);
     
      if (cmdLine.hasOption(helpOpt)) {
        CommandLineUtil.printHelp(group);
        return false;
      }
View Full Code Here

      .withOption(countFileOpt)
      .withOption(outputFileOpt)
      .withOption(solrUrlOpt).create();
   
    try {
      Parser parser = new Parser();
      parser.setGroup(group);
      CommandLine cmdLine = parser.parse(args);
     
      if (cmdLine.hasOption(helpOpt)) {
        CommandLineUtil.printHelp(group);
        return false;
      }
View Full Code Here

      .withOption(outputFileOpt).withOption(limitOpt)
      .withOption(cutoffOpt).create();

   
    try {
      Parser parser = new Parser();
      parser.setGroup(group);
      CommandLine cmdLine = parser.parse(args);
     
      if (cmdLine.hasOption(helpOpt)) {
        CommandLineUtil.printHelp(group);
        return false;
      }
View Full Code Here

      .withOption(textFieldsOpt)
      .withOption(useTermVectorsOpt)
      .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

    .withOption(modelOpt)
    .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

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.