Package joptsimple

Examples of joptsimple.OptionSet.nonOptionArguments()


    OptionSpec<Integer> level = p.accepts("level", "compression level")
    .withOptionalArg().ofType(Integer.class);

    OptionSet opts = p.parse(args.toArray(new String[0]));

    if (opts.nonOptionArguments().size() != 2) {
      err.println("Expected 2 args: from_file to_file (local filenames," +
          " Hadoop URI's, or '-' for stdin/stdout");
      p.printHelpOn(err);
      return 1;
    }
View Full Code Here


        p.accepts("schema", "Schema")
        .withOptionalArg()
        .ofType(String.class);
    OptionSet opts = p.parse(args.toArray(new String[0]));

    List<String> nargs = opts.nonOptionArguments();
    if (nargs.size() != 1) {
      err.println("Expected 1 arg: input_file");
      p.printHelpOn(err);
      return 1;
    }
View Full Code Here

    OptionSpec<String> codec = p.accepts("codec", "compression codec")
    .withOptionalArg().ofType(String.class);

    OptionSet opts = p.parse(args.toArray(new String[0]));

    List<String> nargs = opts.nonOptionArguments();
    if (nargs.size() != 2) {
      err.println("Expected 2 args: from_file to_file (local filenames," +
          " Hadoop URI's, or '-' for stdin/stdout");
      p.printHelpOn(err);
      return 1;
View Full Code Here

      .withRequiredArg()
      .defaultsTo("" + Deflater.DEFAULT_COMPRESSION)
      .ofType(String.class);
    OptionSet opts = optParser.parse(args.toArray(new String[0]));

    List<String> nargs = opts.nonOptionArguments();
    if (nargs.size() > 2) {
      err.println("Expected at most an input file and output file.");
      optParser.printHelpOn(err);
      return 1;
    }
View Full Code Here

    OptionSpec<String> data =
      p.accepts("data", "JSON-encoded request parameters.")
      .withRequiredArg()
      .ofType(String.class);
    OptionSet opts = p.parse(args.toArray(new String[0]));
    args = opts.nonOptionArguments();

    if (args.size() != 3) {
      err.println("Usage: uri protocol_file message_name (-data d | -file f)");
      p.printHelpOn(err);
      return 1;
View Full Code Here

  public int run(InputStream stdin, PrintStream out, PrintStream err,
      List<String> args) throws Exception {
     
    OptionParser p = new OptionParser();
    OptionSet opts = p.parse(args.toArray(new String[0]));
    if (opts.nonOptionArguments().size() != 2) {
      err.println("Expected 2 args: from_file to_file (local filenames," +
      " Hadoop URI's, or '-' for stdin/stdout");
      p.printHelpOn(err);
      return 1;
    }
View Full Code Here

        .withOptionalArg()
        .ofType(String.class);
    OptionSet opts = p.parse(args.toArray(new String[0]));
    String keyName = keyOption.value(opts);
   
    List<String> nargs = opts.nonOptionArguments();
    if (nargs.size() != 1) {
      err.println("Expected 1 arg: input_file");
      p.printHelpOn(err);
      return 1;
    }
View Full Code Here

    OptionSpec<String> data =
      p.accepts("data", "JSON-encoded response datum.")
      .withRequiredArg()
      .ofType(String.class);
    OptionSet opts = p.parse(args.toArray(new String[0]));
    args = opts.nonOptionArguments();

    if (args.size() != 3) {
      err.println("Usage: uri protocol_file message_name (-data d | -file f)");
      p.printHelpOn(err);
      return 1;
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.