static OptionArg<String> createDryRunOpt(Builder builder) { return Option.builder("dr", ArgumentParser.stringParser()) .longName("dry-run") .description( "Will perform a 'dry run' of the experiment without doing any" + " actual simulations. A detailed description of the " + "experiment setup will be printed. If an additional " + "argument 'v' or 'verbose' is supplied, more details of" + " the experiment will be printed.") .setOptionalArgument() .build(); }
static OptionArg<String> createDryRunOpt(Builder builder) { return Option.builder("dr", ArgumentParser.stringParser()) .longName("dry-run") .description( "Will perform a 'dry run' of the experiment without doing any" + " actual simulations. A detailed description of the " + "experiment setup will be printed. If an additional " + "argument 'v' or 'verbose' is supplied, more details of" + " the experiment will be printed.") .setOptionalArgument() .build(); }
static OptionArg<String> createFilterOption(Builder ref) { return Option .builder("f", ArgumentParser.stringParser()) .longName("filter") .description( "Sets a filter of which paths to include. The filter is a string " + "of the form 'syntax:pattern', where 'syntax' is either " + "'glob' or 'regex'. The current filter is '" + ref.pathPredicate + "', there are " + ref.getNumberOfFiles() + " files that satisfy this filter. For more information about" + " the supported syntax please review the documentation of the" + " java.nio.file.FileSystem.getPathMatcher(String) method.") .build(); }
static OptionArg<String> createFilterOption(Builder ref) { return Option .builder("f", ArgumentParser.stringParser()) .longName("filter") .description( "Sets a filter of which paths to include. The filter is a string " + "of the form 'syntax:pattern', where 'syntax' is either " + "'glob' or 'regex'. The current filter is '" + ref.pathPredicate + "', there are " + ref.getNumberOfFiles() + " files that satisfy this filter. For more information about" + " the supported syntax please review the documentation of the" + " java.nio.file.FileSystem.getPathMatcher(String) method.") .build(); }
/** * Test for checking whether duplicate options are detected. */ @Test(expected = IllegalArgumentException.class) public void duplicateOptions() { final Object subject = new Object(); Menu .builder() .add(Option.builder("a").build(), subject, dummyHandler()) .add(Option.builder("aa", ArgumentParser.stringParser()) .longName("a") .build(), subject, CliTest.<Object, String>dummyArgHandler()); }
.add(Option.builder("z").build(), list, dummyHandler()) .closeGroup() .add(Option.builder("as", ArgumentParser.stringParser()).build(), list, new ArgHandler<List<Object>, String>() {