Package org.apache.commons.cli

Examples of org.apache.commons.cli.Options


        this.extension = cmd.getOptionValue("extension") == null ? "dict" : cmd.getOptionValue("extension");
    }

    @Override
    protected Options getOptions() {
        Options options = super.getOptions();

        options.addOption(
                OptionBuilder
                        .withLongOpt("directory")
                        .withDescription("The directory to search for dictionary files")
                        .isRequired()
                        .hasArg(true)
                        .withArgName("dir")
                        .create()
        );

        options.addOption(
                OptionBuilder
                        .withLongOpt("extension")
                        .withDescription("Extension of dictionary files (default: dict)")
                        .hasArg(true)
                        .withArgName("extension")
View Full Code Here


        }
    }

    @Override
    protected Options getOptions() {
        Options options = super.getOptions();

        options.addOption(
                OptionBuilder
                        .withLongOpt("iri")
                        .withDescription("The IRI of the ontology you would like exported")
                        .isRequired()
                        .hasArg(true)
View Full Code Here

        }
    }

    @Override
    protected Options getOptions() {
        Options options = super.getOptions();

        options.addOption(
                OptionBuilder
                        .withLongOpt("out")
                        .withDescription("The output OWL file")
                        .hasArg(true)
                        .withArgName("fileName")
                        .create("o")
        );

        options.addOption(
                OptionBuilder
                        .withLongOpt("iri")
                        .withDescription("The document IRI (URI used for prefixing concepts)")
                        .isRequired()
                        .hasArg(true)
View Full Code Here

        }
    }

    @Override
    protected Options getOptions() {
        Options options = super.getOptions();

        options.addOption(
                OptionBuilder
                        .withLongOpt("in")
                        .withDescription("The input OWL file")
                        .isRequired()
                        .hasArg(true)
                        .withArgName("fileName")
                        .create("i")
        );

        options.addOption(
                OptionBuilder
                        .withLongOpt("iri")
                        .withDescription("The document IRI (URI used for prefixing concepts)")
                        .hasArg(true)
                        .withArgName("uri")
View Full Code Here

 
  /**
   * Build command-line options and descriptions
   */
  public static Options buildOptions() {
    Options options = new Options();

    // Build in/output file arguments, which are required, but there is no
    // addOption method that can specify this
    OptionBuilder.isRequired();
    OptionBuilder.hasArgs();
    OptionBuilder.withLongOpt("outputFile");
    options.addOption(OptionBuilder.create("o"));
   
    OptionBuilder.isRequired();
    OptionBuilder.hasArgs();
    OptionBuilder.withLongOpt("inputFile");
    options.addOption(OptionBuilder.create("i"));
   
    options.addOption("p", "processor", true, "");
    options.addOption("h", "help", false, "");
    options.addOption("skipBlocks", false, "");
    options.addOption("printToScreen", false, "");
    options.addOption("delimiter", true, "");

    return options;
  }
View Full Code Here

   *
   * @param args Command line options
   * @throws IOException
   */
  public static void main(String[] args) throws IOException {
    Options options = buildOptions();
    if(args.length == 0) {
      printUsage();
      return;
    }
   
View Full Code Here

    Option verbose = createBoolOption("verbose", "print verbose output");
    Option info = createBoolOption("info", "print verbose output");
    Option help = createBoolOption("help", "print this help message");
    Option debug = createBoolOption("debug", "print debug output");
   
    allOptions = new Options().
      addOption(input).
      addOption(output).
      addOption(mapper).
      addOption(combiner).
      addOption(reducer).
View Full Code Here

  public static final String OPT_NUM_THREADS = "numThreads";
  public static final String OPT_NUM_APPENDS = "appendsPerThread";

  @SuppressWarnings("static-access")
  public static void main(String []args) throws Throwable {
    Options options = new Options();
    options.addOption(OptionBuilder
      .withLongOpt(OPT_NUM_DNS).hasArg()
      .withDescription("Number of DNs to start")
      .create());
    options.addOption(OptionBuilder
        .withLongOpt(OPT_NUM_THREADS).hasArg()
        .withDescription("number of threads to append from")
        .create());
    options.addOption(OptionBuilder
        .withLongOpt(OPT_NUM_FILES).hasArg()
        .withDescription("number of files to append to")
        .create());
    options.addOption(OptionBuilder
        .withLongOpt(OPT_NUM_APPENDS).hasArg()
        .withDescription("number of appends per thread")
        .create());
    CommandLineParser parser = new GnuParser();
    CommandLine line;
View Full Code Here

   * Create an options parser with the given options to parse the args.
   * @param opts the options
   * @param args the command line arguments
   */
  public GenericOptionsParser(Options opts, String[] args) {
    this(new Configuration(), new Options(), args);
  }
View Full Code Here

  /**
   * Create an options parser to parse the args.
   * @param args the command line arguments
   */
  public GenericOptionsParser(String[] args) {
    this(new Configuration(), new Options(), args);
  }
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.