/** * Add a help option. A help option is a special option that will trigger * the display of the help menu. A help option may not be added to a group. * @param sn The short name of the help option. * @param ln The long name of the help option. * @param desc The description of the help option. * @return This, as per the builder pattern. */ public Builder addHelpOption(String sn, String ln, String desc) { checkState(!buildingGroup, "A help option can not be added to a group."); final OptionNoArg option = Option.builder(sn) .longName(ln) .description(desc) .buildHelpOption(); add(new HelpParser(option)); addedHelpOption = true; return this; }
assertEquals("A", Option.builder("A").build().getShortName()); assertFalse(Option.builder("A").build().getLongName().isPresent()); final Option o = Option.builder("A-T").longName("APPLE-TREE").build(); assertEquals("A-T", o.getShortName()); assertEquals("APPLE-TREE", o.getLongName().get());
static OptionNoArg createLocalOpt(Builder builder) { return Option.builder("l") .longName("local") .description( "Compute the experiment locally", builder.getComputer() == Computers.LOCAL ? DEFAULT_LABEL : "", ". This option can not be used together with the --jppf option.") .build(); }
static OptionNoArg createJppfOpt(Builder builder) { return Option.builder("j") .longName("jppf") .description( "Compute the experiment using the JPPF framework", builder.getComputer() == Computers.DISTRIBUTED ? DEFAULT_LABEL : "", ". This option can not be used together with the --local option.") .build(); }
static OptionNoArg createLocalOpt(Builder builder) { return Option.builder("l") .longName("local") .description( "Compute the experiment locally", builder.getComputer() == Computers.LOCAL ? DEFAULT_LABEL : "", ". This option can not be used together with the --jppf option.") .build(); }
static OptionNoArg createJppfOpt(Builder builder) { return Option.builder("j") .longName("jppf") .description( "Compute the experiment using the JPPF framework", builder.getComputer() == Computers.DISTRIBUTED ? DEFAULT_LABEL : "", ". This option can not be used together with the --local option.") .build(); }