Package joptsimple

Examples of joptsimple.OptionParser.printHelpOn()


                        .defaultsTo(1);

        OptionSet options = parser.parse(args);

        if (options.has("h")) {
            parser.printHelpOn(System.out);
            System.exit(1);
        }

        final int threads = threadsOption.value(options);
        final int batchSize = batchSizeOption.value(options);
View Full Code Here


                        .defaultsTo(1000);

        OptionSet options = parser.parse(args);

        if (options.has("h")) {
            parser.printHelpOn(System.out);
            System.exit(1);
        }

        final int threads = threadsOption.value(options);
        final int batchSize = batchSizeOption.value(options);
View Full Code Here

        try {
            options = parser.parse(args);
        } catch (OptionException e) {
            System.out.println("Error parsing command line options:");
            System.out.println(e.getMessage());
            parser.printHelpOn(System.out);
            System.exit(1);
        }

        boolean enableJmx = options.has(enableJmxOption);
        String zkConnectString = options.valueOf(zkOption);
View Full Code Here

        }

        // check if user asked for basic things as early as we can, don't
        // wanna go doing anything we don't need to.
        if ( options == null || options.has(Options.OPT_HELP) ) {
            parser.printHelpOn( System.out );
            exit( false );
        }
       
        // print version info?
        if ( options.has(Options.OPT_VERSION) ) {
View Full Code Here

    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;
    }

    URI uri = new URI(args.get(0));
    Protocol protocol = Protocol.parse(new File(args.get(1)));
View Full Code Here

    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;
    }

    URI uri = new URI(args.get(0));
    Protocol protocol = Protocol.parse(new File(args.get(1)));
View Full Code Here

    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;
    }

    BufferedInputStream inStream = Util.fileOrStdin(args.get(0), stdin);
    BufferedOutputStream outStream = Util.fileOrStdout(args.get(1), out);
View Full Code Here

    DataFileStream<Object> fileReader =
      new DataFileStream<Object>(inStream, reader);

    if (!fileReader.getSchema().equals(Schema.parse(TEXT_FILE_SCHEMA))) {
      err.println("Avro file is not generic text schema");
      p.printHelpOn(err);
      return 1;
    }
   
    while (fileReader.hasNext()) {
      ByteBuffer outBuff = (ByteBuffer) fileReader.next();
View Full Code Here

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

    if (opts.nonOptionArguments().size() != 2) {
      err.println("Expected 2 args: schema input_file");
      p.printHelpOn(err);
      return 1;
    }

    Schema schema = Schema.parse(args.get(0));
    DatumReader<Object> reader = new GenericDatumReader<Object>(schema);
View Full Code Here

    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;
    }
    BufferedInputStream inStream = Util.fileOrStdin(args.get(0), stdin);
    BufferedOutputStream outStream = Util.fileOrStdout(args.get(1), out);
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.