Package org.apache.commons.cli

Examples of org.apache.commons.cli.Options


       
        return options;
    }
   
    public static void main(String[] args) throws Exception {
      Options options = getOptions();
      try {
       
        CommandLineParser parser = new GnuParser();

        CommandLine line = parser.parse( options, args );
View Full Code Here


            .create("dir");
        Option name = OptionBuilder.withArgName("name")
            .hasArg()
            .withDescription("list files with given name")
            .create("name");
        Options options = new Options();

        options.addOption(dir);
        options.addOption(name);
       
        return options;
    }
View Full Code Here

       
        return options;
    }
   
    public static void main(String[] args) throws Exception {
        Options options = getOptions();
        try {
       
            CommandLineParser parser = new GnuParser();
   
            CommandLine line = parser.parse(options, args);
View Full Code Here

    private static Options getOptions() {
        Option dir = OptionBuilder.withArgName( "dir" )
            .hasArg()
            .withDescription"list files in given dir" )
            .create( "dir" );
        Options options = new Options();

        options.addOption(dir);
       
        return options;
    }
View Full Code Here

       
        return options;
    }
   
    public static void main(String[] args) throws Exception {
      Options options = getOptions();
      try {
       
        CommandLineParser parser = new GnuParser();

        CommandLine line = parser.parse( options, args );
View Full Code Here

      e.printStackTrace();
    }
  }

  public static Options loadOptions() {
    Options opt = new Options();
    opt.addOption("s", "schemaLocation", true, "location of the schema");
    opt.addOption("minStringLength", true,  "Minimum length of string to be generated");
    opt.addOption("maxStringLength", true,  "Maximum length of string to be generated");
    opt.addOption("minIntegerRange", true,  "Start range of integer");
    opt.addOption("maxIntegerRange", true,  "End range of integer");
    opt.addOption("minLongRange", true,    "Start range of long");
    opt.addOption("maxLongRange", true,  "End range of long");
    opt.addOption("maxBytesLength", true,  "Maximum length of the bytes to be generated");
    opt.addOption(PRINT_AVRO_JSON_OPTNAME, true,  "Replace the default human-readable JSON serialization with" +
                  " the standard Avro JSON serialization of the record which can be deserialized back to a " +
                  " record. The result is printed out to a file or to the standard output (-)." );

    return opt;
  }
View Full Code Here

  public static void main(String[] args) throws IOException, UnknownTypeException {

    // load and verify the options
    CommandLineParser parser = new PosixParser();
    Options opts = loadOptions();

    CommandLine cmd = null;
    try {
      cmd = parser.parse(opts, args);
    } catch (org.apache.commons.cli.ParseException parseEx) {
View Full Code Here

  private RunQueriesThrift() {}

  @SuppressWarnings("static-access")
  public static void main(String[] args) throws Exception {
    Options options = new Options();

    options.addOption(OptionBuilder.withArgName("string").hasArg()
        .withDescription("host").create(HOST_OPTION));
    options.addOption(OptionBuilder.withArgName("port").hasArg()
        .withDescription("port").create(PORT_OPTION));
    options.addOption(OptionBuilder.withArgName("file").hasArg()
        .withDescription("file containing topics in TREC format").create(QUERIES_OPTION));
    options.addOption(OptionBuilder.withArgName("num").hasArg()
        .withDescription("number of results to return").create(NUM_RESULTS_OPTION));
    options.addOption(OptionBuilder.withArgName("string").hasArg()
        .withDescription("group id").create(GROUP_OPTION));
    options.addOption(OptionBuilder.withArgName("string").hasArg()
        .withDescription("access token").create(TOKEN_OPTION));
    options.addOption(OptionBuilder.withArgName("string").hasArg()
        .withDescription("runtag").create(RUNTAG_OPTION));
    options.addOption(new Option(VERBOSE_OPTION, "print out complete document"));

    CommandLine cmdline = null;
    CommandLineParser parser = new GnuParser();
    try {
      cmdline = parser.parse(options, args);
View Full Code Here

  private RunQueriesBaselineThrift() {}

  @SuppressWarnings("static-access")
  public static void main(String[] args) throws Exception {
    Options options = new Options();

    options.addOption(OptionBuilder.withArgName("string").hasArg()
        .withDescription("host").create(HOST_OPTION));
    options.addOption(OptionBuilder.withArgName("port").hasArg()
        .withDescription("port").create(PORT_OPTION));
    options.addOption(OptionBuilder.withArgName("file").hasArg()
        .withDescription("file containing topics in TREC format").create(QUERIES_OPTION));
    options.addOption(OptionBuilder.withArgName("num").hasArg()
        .withDescription("number of results to return").create(NUM_RESULTS_OPTION));
    options.addOption(OptionBuilder.withArgName("string").hasArg()
        .withDescription("group id").create(GROUP_OPTION));
    options.addOption(OptionBuilder.withArgName("string").hasArg()
        .withDescription("access token").create(TOKEN_OPTION));
    options.addOption(OptionBuilder.withArgName("string").hasArg()
        .withDescription("runtag").create(RUNTAG_OPTION));
    options.addOption(new Option(VERBOSE_OPTION, "print out complete document"));

    CommandLine cmdline = null;
    CommandLineParser parser = new GnuParser();
    try {
      cmdline = parser.parse(options, args);
View Full Code Here

    private static final String HTML_OPTION = "html";
   
    @SuppressWarnings("static-access")
    public static void main(String[] args) throws Exception {
  Options options = new Options();
  options.addOption(OptionBuilder.withArgName("path").hasArg()
        .withDescription("HTML file from twitter.com").create(HTML_OPTION));
 
  CommandLine cmdline = null;
  CommandLineParser parser = new GnuParser();
  try {
View Full Code Here

TOP

Related Classes of org.apache.commons.cli.Options

Copyright © 2018 www.massapicom. 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.