Examples of acceptsAll()


Examples of joptsimple.OptionParser.acceptsAll()

        ArgumentAcceptingOptionSpec<Integer> userAgentCacheSpec =
                parser.accepts("uaCache", "The number of days to cache a database of User-Agent records from http://user-agent-string.info")
                        .withOptionalArg().ofType(Integer.class).defaultsTo(1);

        parser.acceptsAll(asList("help", "?"), "This help text");

        OptionSet options = parser.parse(args);

        if (options.has("?")) {
            try {
View Full Code Here

Examples of joptsimple.OptionParser.acceptsAll()

  }

  @Test
  public void withDefaultNonOptionArgsNameAndNoNonOptionArgsPresent() {
    OptionParser parser = new OptionParser();
    parser.acceptsAll(Arrays.asList("o1","option1")).withRequiredArg();
    parser.accepts("o2");
    OptionSet optionSet = parser.parse("--o1=v1", "--o2");
    EnumerablePropertySource<?> ps = new JOptCommandLinePropertySource(optionSet);

    assertThat(ps.containsProperty("nonOptionArgs"), is(false));
View Full Code Here

Examples of joptsimple.OptionParser.acceptsAll()

public class OptionSynonymTest {
    @Test
    public void supportsOptionSynonyms() {
        OptionParser parser = new OptionParser();
        List<String> synonyms = asList( "message", "blurb", "greeting" );
        parser.acceptsAll( synonyms ).withRequiredArg();
        String expectedMessage = "Hello";

        OptionSet options = parser.parse( "--message", expectedMessage );

        for ( String each : synonyms ) {
View Full Code Here

Examples of joptsimple.OptionParser.acceptsAll()

    public void configure(Binder binder) {
        OptionParser parser = new OptionParser();
        ArgumentAcceptingOptionSpec<Integer> portSpec =
                parser.accepts("port", "The port to listen on")
                        .withOptionalArg().ofType(Integer.class).defaultsTo(8080);
        parser.acceptsAll(asList("help", "?"), "This help text");

        OptionSet options = parser.parse(args);

        if (options.has("?")) {
            try {
View Full Code Here

Examples of joptsimple.OptionParser.acceptsAll()

                .accepts("storage", "Index storage enabled").withOptionalArg()
                .ofType(Boolean.class);
        OptionSpec<File> csvFile =
                parser.accepts("csvFile", "File to write a CSV version of the benchmark data.")
                        .withOptionalArg().ofType(File.class);
        OptionSpec help = parser.acceptsAll(asList("h", "?", "help"), "show help").forHelp();
        OptionSpec<String> nonOption = parser.nonOptions();

        OptionSet options = parser.parse(args);

        if (options.has(help)) {
View Full Code Here

Examples of joptsimple.OptionParser.acceptsAll()

        final OptionParser parser = new OptionParser();
        final OptionSpec<String> host = parser.accepts("host", "master host").withRequiredArg().ofType(String.class).defaultsTo(defaultHost);
        final OptionSpec<Integer> port = parser.accepts("port", "master port").withRequiredArg().ofType(Integer.class).defaultsTo(defaultPort);
        final OptionSpec<Integer> interval = parser.accepts("interval", "interval between successive executions").withRequiredArg().ofType(Integer.class);
        final OptionSpec<Boolean> secure = parser.accepts("secure", "use secure connections").withRequiredArg().ofType(Boolean.class);
        final OptionSpec<?> help = parser.acceptsAll(asList("h", "?", "help"), "show help").forHelp();
        final OptionSpec<String> nonOption = parser.nonOptions(Mode.STANDBY + " <path to repository>");

        final OptionSet options = parser.parse(args);
        final List<String> nonOptions = nonOption.values(options);
View Full Code Here

Examples of joptsimple.OptionParser.acceptsAll()

        final OptionParser parser = new OptionParser();
        final OptionSpec<Integer> port = parser.accepts("port", "port to listen").withRequiredArg().ofType(Integer.class).defaultsTo(defaultPort);
        final OptionSpec<Boolean> secure = parser.accepts("secure", "use secure connections").withRequiredArg().ofType(Boolean.class);
        final OptionSpec<String> admissible = parser.accepts("admissible", "list of admissible slave host names or ip ranges").withRequiredArg().ofType(String.class);
        final OptionSpec<?> help = parser.acceptsAll(asList("h", "?", "help"), "show help").forHelp();
        final OptionSpec<String> nonOption = parser.nonOptions(Mode.PRIMARY + " <path to repository>");

        final OptionSet options = parser.parse(args);
        final List<String> nonOptions = nonOption.values(options);
View Full Code Here

Examples of joptsimple.OptionParser.acceptsAll()

        //TODO add support for other NodeStore flags
        OptionParser parser = new OptionParser();
        OptionSpec<Integer> clusterId = parser
                .accepts("clusterId", "MongoMK clusterId").withRequiredArg()
                .ofType(Integer.class).defaultsTo(0);
        OptionSpec<?> help = parser.acceptsAll(asList("h", "?", "help"),
                "show help").forHelp();
        OptionSpec<String> nonOption = parser
                .nonOptions(h);

        OptionSet options = parser.parse(args);
View Full Code Here

Examples of org.mule.api.exception.MessagingExceptionHandlerAcceptor.acceptsAll()

                    "No global exception strategy defined with name %s.", defaultExceptionStrategyName)));
            }
            if (messagingExceptionHandler instanceof MessagingExceptionHandlerAcceptor)
            {
                MessagingExceptionHandlerAcceptor messagingExceptionHandlerAcceptor = (MessagingExceptionHandlerAcceptor) messagingExceptionHandler;
                if (!messagingExceptionHandlerAcceptor.acceptsAll())
                {
                    throw new MuleRuntimeException(
                        CoreMessages.createStaticMessage("Default exception strategy must not have expression attribute. It must accept any message."));
                }
            }
View Full Code Here

Examples of org.mule.api.exception.MessagingExceptionHandlerAcceptor.acceptsAll()

    private void validateOnlyLastAcceptsAll()
    {
        for (int i = 0; i < exceptionListeners.size() - 1; i++)
        {
            MessagingExceptionHandlerAcceptor messagingExceptionHandlerAcceptor = exceptionListeners.get(i);
            if (messagingExceptionHandlerAcceptor.acceptsAll())
            {
                throw new MuleRuntimeException(CoreMessages.createStaticMessage("Only last exception strategy inside <choice-exception-strategy> can accept any message. Maybe expression attribute is empty."));
            }
        }
    }
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.