Package org.apache.commons.cli

Examples of org.apache.commons.cli.Parser


    Options options = new Options();
    Daemonizer.buildOptions(options);
    options.addOption(ARG_RESOURCES, true, "resources");

    Parser parser = new GnuParser();
    CommandLine cli = parser.parse(options, args);

    boolean isDaemon = Daemonizer.handleDaemonization(cli);

    List<String> resources = getResources(cli);
    ContainerLibrary.createContext(resources);
View Full Code Here


  private static final Pattern TEXT_PATTERN = Pattern.compile("^\"(.*)\" \".*\"$");

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

    Parser parser = new GnuParser();
    Options options = buildOptions();
    CommandLine cli = parser.parse(options, args);

    String host = cli.getOptionValue(ARG_HOSTNAME, "localhost");
    int port = Integer.parseInt(cli.getOptionValue(ARG_PORT, "8001"));
    String callerId = cli.getOptionValue(ARG_CALLER_ID, "2000");

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

      options.addOption(option);

    }

    Parser createParser() {
      Parser result = new BasicParser();
      return result;
    }
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

    String ctxName = System.getProperty("context", "openmeetings");
    File home = new File(System.getenv("RED5_HOME"));
    omHome = new File(new File(home, "webapps"), ctxName);
    File omUploadTemp = new File(omHome, OpenmeetingsVariables.UPLOAD_TEMP_DIR);
   
    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

  }
 
  public static void main(String[] args) throws Exception {
    setupOptions();
   
    Parser p = new BasicParser();
    CommandLine cl = null;
   
    try {
      cl = p.parse(opts, args);
    } catch (ParseException e) {
      throw new RuntimeException(e);
    }
    String[] rargs = cl.getArgs();
    if (rargs.length != 1) {
View Full Code Here

    }
   
  }
 
  public static void main(String[] args) throws Exception {
    Parser p = new BasicParser();
   
    CommandLine cl = null;
    try {
      cl = p.parse(opts, args);
    } catch (ParseException e) {
      System.out.println("Parse Exception, exiting.");
      return;
    }
   
View Full Code Here

  public static void main(String[] argv) {

    // Parse command line arguments
    CommandLine args = null;
    try {
      Parser p = new BasicParser();
      args = p.parse(cliOpts, argv);
    } catch (ParseException e) {
      log.error(e.getMessage(), e);
    }

    // Check for help
View Full Code Here

        0,
        optionsArgs.length);
    final String[] operationsArgs = new String[] {
      args[0]
    };
    final Parser parser = new BasicParser();
    CommandLine operationCommandLine;
    try {
      operationCommandLine = parser.parse(
          operations,
          operationsArgs);
      final OperationCommandLineOptions operationOption = OperationCommandLineOptions.parseOptions(operationCommandLine);
      operationOption.getOperation().getDriver().run(
          optionsArgs);
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.