Package joptsimple

Examples of joptsimple.OptionParser.accepts()


        parser.accepts("db", "Database name").withRequiredArg();
        parser.acceptsAll(asList("u", "user"), "DB username.").withRequiredArg();
        parser.acceptsAll(asList("P", "password"), "DB password").withRequiredArg();
        parser.acceptsAll(asList("p", "port"), "DB port").withRequiredArg();
        parser.acceptsAll(asList("h", "host"), "DB host").withRequiredArg();
        parser.accepts("requests").withRequiredArg().ofType(Integer.class);
        parser.accepts("request-file").withRequiredArg();
        parser.accepts("threads").withRequiredArg().ofType(Integer.class);
        OptionSet options = parser.parse(args);

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


        parser.acceptsAll(asList("u", "user"), "DB username.").withRequiredArg();
        parser.acceptsAll(asList("P", "password"), "DB password").withRequiredArg();
        parser.acceptsAll(asList("p", "port"), "DB port").withRequiredArg();
        parser.acceptsAll(asList("h", "host"), "DB host").withRequiredArg();
        parser.accepts("requests").withRequiredArg().ofType(Integer.class);
        parser.accepts("request-file").withRequiredArg();
        parser.accepts("threads").withRequiredArg().ofType(Integer.class);
        OptionSet options = parser.parse(args);

        if(options.has("help")) {
            parser.printHelpOn(System.out);
View Full Code Here

        parser.acceptsAll(asList("P", "password"), "DB password").withRequiredArg();
        parser.acceptsAll(asList("p", "port"), "DB port").withRequiredArg();
        parser.acceptsAll(asList("h", "host"), "DB host").withRequiredArg();
        parser.accepts("requests").withRequiredArg().ofType(Integer.class);
        parser.accepts("request-file").withRequiredArg();
        parser.accepts("threads").withRequiredArg().ofType(Integer.class);
        OptionSet options = parser.parse(args);

        if(options.has("help")) {
            parser.printHelpOn(System.out);
            System.exit(0);
View Full Code Here

    }

    @SuppressWarnings("unchecked")
    public static void main(String[] args) throws IOException {
        OptionParser parser = new OptionParser();
        parser.accepts("k", "key size").withRequiredArg().ofType(Integer.class);
        parser.accepts("v", "value size").withRequiredArg().ofType(Integer.class);
        parser.accepts("p", "prefix").withRequiredArg();

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

    @SuppressWarnings("unchecked")
    public static void main(String[] args) throws IOException {
        OptionParser parser = new OptionParser();
        parser.accepts("k", "key size").withRequiredArg().ofType(Integer.class);
        parser.accepts("v", "value size").withRequiredArg().ofType(Integer.class);
        parser.accepts("p", "prefix").withRequiredArg();

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

    @SuppressWarnings("unchecked")
    public static void main(String[] args) throws IOException {
        OptionParser parser = new OptionParser();
        parser.accepts("k", "key size").withRequiredArg().ofType(Integer.class);
        parser.accepts("v", "value size").withRequiredArg().ofType(Integer.class);
        parser.accepts("p", "prefix").withRequiredArg();

        OptionSet options = parser.parse(args);
        List<String> nonOptions = (List<String>) options.nonOptionArguments();

        if(nonOptions.size() != 3) {
View Full Code Here

    @SuppressWarnings("unchecked")
    public static void main(String[] args) throws Exception {

        OptionParser parser = new OptionParser();
        parser.accepts(CONNECTION_TIMEOUT, "Connection timeout (ms)")
              .withRequiredArg()
              .ofType(Integer.class);
        parser.accepts(ROUTING_TIMEOUT, "Routing timeout (ms)")
              .withRequiredArg()
              .ofType(Integer.class);
View Full Code Here

        OptionParser parser = new OptionParser();
        parser.accepts(CONNECTION_TIMEOUT, "Connection timeout (ms)")
              .withRequiredArg()
              .ofType(Integer.class);
        parser.accepts(ROUTING_TIMEOUT, "Routing timeout (ms)")
              .withRequiredArg()
              .ofType(Integer.class);
        parser.accepts(SOCKET_TIMEOUT, "Socket timeout (ms)")
              .withRequiredArg()
              .ofType(Integer.class);
View Full Code Here

              .withRequiredArg()
              .ofType(Integer.class);
        parser.accepts(ROUTING_TIMEOUT, "Routing timeout (ms)")
              .withRequiredArg()
              .ofType(Integer.class);
        parser.accepts(SOCKET_TIMEOUT, "Socket timeout (ms)")
              .withRequiredArg()
              .ofType(Integer.class);
        parser.accepts(MAX_CONNECTIONS, "Max connections per node")
              .withRequiredArg()
              .ofType(Integer.class);
View Full Code Here

              .withRequiredArg()
              .ofType(Integer.class);
        parser.accepts(SOCKET_TIMEOUT, "Socket timeout (ms)")
              .withRequiredArg()
              .ofType(Integer.class);
        parser.accepts(MAX_CONNECTIONS, "Max connections per node")
              .withRequiredArg()
              .ofType(Integer.class);
        parser.accepts(MAX_CONNECTIONS_TOTAL, "Max total connections")
              .withRequiredArg()
              .ofType(Integer.class);
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.