Package joptsimple

Examples of joptsimple.OptionSet.nonOptionArguments()


        OptionSet options = parser.parse( "-f", "-d" );

        assertTrue( options.has( "f" ) );
        assertFalse( options.has( "d" ) );
        assertEquals( asList( "-d" ), options.nonOptionArguments() );
    }
}
View Full Code Here


        assertTrue( options.has( "i" ) );
        assertTrue( options.has( "j" ) );
        assertTrue( options.has( "k" ) );
        assertEquals( asList( "bar", "junk" ), options.valuesOf( "i" ) );
        assertEquals( asList( "ixnay" ), options.valuesOf( "j" ) );
        assertEquals( asList( "xyz", "foo", "blah", "bah" ), options.nonOptionArguments() );

        parser.posixlyCorrect( true );
        options = parser.parse( arguments );

        assertTrue( options.has( "i" ) );
View Full Code Here

        assertTrue( options.has( "i" ) );
        assertFalse( options.has( "j" ) );
        assertFalse( options.has( "k" ) );
        assertEquals( asList( "bar", "junk" ), options.valuesOf( "i" ) );
        assertEquals( emptyList(), options.valuesOf( "j" ) );
        assertEquals( asList( "xyz", "-jixnay", "foo", "-k", "blah", "--", "bah" ), options.nonOptionArguments() );
    }
}
View Full Code Here

      parser.printHelpOn(System.err);
      System.err.println();
      System.err.println(e.getMessage());
      System.exit(2);
    }
    if (! opts.nonOptionArguments().isEmpty()) {
      if (! extraOk) {
        parser.printHelpOn(System.err);
        System.err.println();
        System.err.println("Unrecognized argument, \""+opts.nonOptionArguments().get(0)+"\"");
        System.exit(2);
View Full Code Here

    }
    if (! opts.nonOptionArguments().isEmpty()) {
      if (! extraOk) {
        parser.printHelpOn(System.err);
        System.err.println();
        System.err.println("Unrecognized argument, \""+opts.nonOptionArguments().get(0)+"\"");
        System.exit(2);
      }
    }
    if (opts.has("h") || opts.has("help")) {
      parser.printHelpOn(System.out);
View Full Code Here

    parser.accepts("url","DovetailDB server URL").withRequiredArg().defaultsTo("http://127.0.0.1:19156");
    parser.accepts("log","Log level (WARNING,INFO,FINER)").withRequiredArg().defaultsTo("info");
    parser.accepts("help","Help");
    OptionSet opts = Main.parseWithHelp(argv, parser, true);
   
    List<String> codefiles = opts.nonOptionArguments();
   
    UploadCode uploader = new UploadCode((String)opts.valueOf("url"));
    Level level = Level.parse((String) opts.valueOf("log"));
    setLogLevel(level);
    if (opts.has("accesskey")) {
View Full Code Here

        assertTrue( options.hasArgument( "c" ) );
        assertEquals( asList( "bar" ), options.valuesOf( "c" ) );
        assertFalse( options.has( "d" ) );
        assertFalse( options.has( "e" ) );
        assertFalse( options.has( "f" ) );
        assertEquals( asList( "-d", "-e", "baz", "-f", "biz" ), options.nonOptionArguments() );
    }
}
View Full Code Here

            new GetPrincipalTest(
                    numberOfUsers.value(options),
                    flatStructure.value(options))
        };

        Set<String> argset = Sets.newHashSet(options.nonOptionArguments());
        List<RepositoryFixture> fixtures = Lists.newArrayList();
        for (RepositoryFixture fixture : allFixtures) {
            if (argset.remove(fixture.toString())) {
                fixtures.add(fixture);
            }
View Full Code Here

        OptionParser parser = new OptionParser();
        parser.accepts("datastore", "keep data store");

        OptionSet options = parser.parse(args);

        List<String> argList = options.nonOptionArguments();
        if (argList.size() == 2 || argList.size() == 3) {
            File dir = new File(argList.get(0));
            File xml = new File(dir, "repository.xml");
            String dst = argList.get(1);
            if (argList.size() == 3) {
View Full Code Here

        OptionSet options = parser.parse(args);

        OakFixture oakFixture;

        List<String> arglist = options.nonOptionArguments();
        String uri = (arglist.isEmpty()) ? defaultUri : arglist.get(0);
        String fix = (arglist.size() <= 1) ? OakFixture.OAK_MEMORY : arglist.get(1);

        int cacheSize = cache.value(options);
        List<Integer> cIds = Collections.emptyList();
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.