Package org.apache.commons.cli2.builder

Examples of org.apache.commons.cli2.builder.GroupBuilder.withOption()


        .withArgument(argumentBuilder.withConsumeRemaining("file path").withMinimum(1).withMaximum(1).create())
        .withDescription("the file path of labelled results").withChildren(labelsGroup).create();

    // parse the input
    Parser parser = new Parser();
    Group normalOption = groupBuilder.withOption(inputOption).withOption(modelOption).withOption(outputOption).create();
    parser.setGroup(normalOption);
    CommandLine commandLine = parser.parseAndHelp(args);
    if (commandLine == null) {
      return false;
    }
View Full Code Here


    final GroupBuilder gbuilder = new GroupBuilder();
   
    for(final Iterator i = optionGroup1.getOptions().iterator();i.hasNext();){
      final org.apache.commons.cli.Option option1 = (org.apache.commons.cli.Option)i.next();
      final Option option2 = option(option1);
      gbuilder.withOption(option2);
    }
   
    gbuilder.withMaximum(1);
   
    if(optionGroup1.isRequired()){
View Full Code Here

    final Set optionGroups = new HashSet();
   
    for(final Iterator i = options1.getOptionGroups().iterator();i.hasNext();){
      final OptionGroup optionGroup1 = (OptionGroup)i.next();
      Group group = group(optionGroup1);
      gbuilder.withOption(group);
      optionGroups.add(optionGroup1);
    }
   
    for(final Iterator i = options1.getOptions().iterator();i.hasNext();){
      final org.apache.commons.cli.Option option1 = (org.apache.commons.cli.Option)i.next();
View Full Code Here

   
    for(final Iterator i = options1.getOptions().iterator();i.hasNext();){
      final org.apache.commons.cli.Option option1 = (org.apache.commons.cli.Option)i.next();
      if(!optionInAGroup(option1,optionGroups)){
        final Option option2 = option(option1);
        gbuilder.withOption(option2);
      }
    }
   
    return gbuilder.create();
  }
View Full Code Here

        options.add(tikaOpt);
        Option mimeTypeOpt = buildOption("mimeType", "m",
                "The mime type to use (optional)", true, false, "");
        options.add(mimeTypeOpt);
        for (Option opt : options) {
            gBuilder = gBuilder.withOption(opt);
        }

        Group group = gBuilder.create();

        try {
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.