Package org.apache.commons.cli

Examples of org.apache.commons.cli.Parser


    cli.addOption("jobconf", false,
        "\"n1=v1,n2=v2,..\" (Deprecated) Optional. Add or override a JobConf property.",
        "key=val");
    cli.addOption("lazyOutput", false, "Optional. Create output lazily",
                  "boolean");
    Parser parser = cli.createParser();
    try {
     
      GenericOptionsParser genericParser = new GenericOptionsParser(getConf(), args);
      CommandLine results = parser.parse(cli.options, genericParser.getRemainingArgs());
     
      JobConf job = new JobConf(getConf());
     
      if (results.hasOption("input")) {
        FileInputFormat.setInputPaths(job, results.getOptionValue("input"));
View Full Code Here


      options.addOption(option);

    }

    Parser createParser() {
      Parser result = new BasicParser();
      return result;
    }
View Full Code Here

            // Setup options
            Options options = createOptions();

            // Parse command line
            // GNU parser allow multi-letter short options
            Parser parser = new GnuParser();
            CommandLine cl = null;
            cl = parser.parse(options, args);
            if (cl.hasOption("h")) {
                // automatically generate the help statement
                HelpFormatter formatter = new HelpFormatter();
                formatter.printHelp("BookMaker", options);
                System.exit(0);
View Full Code Here

  private void process(String[] args) {
    String ctxName = System.getProperty("context", "openmeetings");
    File home = new File(System.getenv("RED5_HOME"));
    OmFileHelper.setOmHome(new File(new File(home, "webapps"), ctxName));
   
    Parser parser = new PosixParser();
    try {
      cmdl = parser.parse(opts, args);
    } catch (ParseException e) {
      System.out.println(e.getMessage());
      usage();
      System.exit(1);
    }
View Full Code Here

     *        the arguments
     */
    private void run(String[] args) {
        try {
            // parse arguments
            Parser parser = new BasicParser();
            org.apache.commons.cli.CommandLine cl = parser.parse(options, args);

            // Set locale
            this.setLocale(cl);

            // Welcome message
View Full Code Here

        false,
        "\"n1=v1,n2=v2,..\" (Deprecated) Optional. Add or override a JobConf property.",
        "key=val");

    cli.addOption("program", false, "URI to application executable", "class");
    Parser parser = cli.createParser();
    try {

      // check generic arguments -conf
      GenericOptionsParser genericParser = new GenericOptionsParser(getConf(),
          args);
      // get other arguments
      CommandLine results = parser.parse(cli.options,
          genericParser.getRemainingArgs());

      BSPJob job = new BSPJob(getConf());

      if (results.hasOption("input")) {
View Full Code Here

      options.addOption(option);

    }

    Parser createParser() {
      Parser result = new BasicParser();
      return result;
    }
View Full Code Here

  private void process(String[] args) {
    String ctxName = System.getProperty("context", "openmeetings");
    File home = new File(System.getenv("RED5_HOME"));
    OmFileHelper.setOmHome(new File(new File(home, "webapps"), ctxName));
   
    Parser parser = new PosixParser();
    try {
      cmdl = parser.parse(opts, args);
    } catch (ParseException e) {
      System.out.println(e.getMessage());
      usage();
      System.exit(1);
    }
View Full Code Here

    cli.addOption("jobconf", false,
        "\"n1=v1,n2=v2,..\" (Deprecated) Optional. Add or override a JobConf property.",
        "key=val");
    cli.addOption("lazyOutput", false, "Optional. Create output lazily",
                  "boolean");
    Parser parser = cli.createParser();
    try {
     
      GenericOptionsParser genericParser = new GenericOptionsParser(getConf(), args);
      CommandLine results = parser.parse(cli.options, genericParser.getRemainingArgs());
     
      JobConf job = new JobConf(getConf());
     
      if (results.hasOption("input")) {
        FileInputFormat.setInputPaths(job, results.getOptionValue("input"));
View Full Code Here

      options.addOption(option);

    }

    Parser createParser() {
      Parser result = new BasicParser();
      return result;
    }
View Full Code Here

TOP

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

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.