Examples of PosixParser


Examples of org.apache.commons.cli.PosixParser

        Integer partialLength = null// default is full length
        float fraction = 0.1f;
        String rdmSelectedRank = null;
        int min_bootstrap_words = NBClassifier.MIN_BOOTSTRSP_WORDS;
        try {
            CommandLine line = new PosixParser().parse(options, args);
            if (line.hasOption(TRAIN_TAXONFILE_SHORT_OPT) ) {
              tax_file = line.getOptionValue(TRAIN_TAXONFILE_SHORT_OPT);
            } else {
                throw new ParseException("Taxonomy file must be specified");
            }
View Full Code Here

Examples of org.apache.commons.cli.PosixParser

        PrintStream outStream = null;
        AlignmentMode mode = AlignmentMode.overlap;
        boolean show_alignment = false;
      
         try {
            CommandLine line = new PosixParser().parse(options, args);

            if (line.hasOption("show_alignment")) {
                show_alignment = true;
            }
            if (line.hasOption("alignment-mode")) {
View Full Code Here

Examples of org.apache.commons.cli.PosixParser

        return this;
    }

    // Parse the given argument vector
    public Command parse(String[] argv) {
        CommandLineParser parser = new PosixParser();

        CommandLine cmdline = null;
        try {
            cmdline = parser.parse(this.rules, argv);
        }
        catch (ParseException e) {
            error(e.getMessage());
        }
View Full Code Here

Examples of org.apache.commons.cli.PosixParser

  }

  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) {
      LOG.error("Invalid option");
      printHelp(opts);
      return;
    }
View Full Code Here

Examples of org.apache.commons.cli.PosixParser

    options.addOption(option);

    option = new Option("t", "graphite-port",  true, "Graphite server port");
    options.addOption(option);

    CommandLineParser parser = new PosixParser();
    CommandLine commandLine = null;
    try {
      commandLine = parser.parse(options, args);
    }
    catch(ParseException exception) {
      System.err.println(exception.getMessage());
      System.err.println("Usage: " + PushBot.class + " ARGS");
      System.err.println("  -n,--name                IRC Nick of the Bot");
View Full Code Here

Examples of org.apache.commons.cli.PosixParser

        options.addOption("t", "theme", true, "the theme to compile");
        options.addOption("f", "theme-folder", true,
                "the folder containing the theme");
        options.addOption("v", "version", true,
                "the Vaadin version to compile for");
        CommandLineParser parser = new PosixParser();
        CommandLine params = parser.parse(options, args);
        if (!params.hasOption("theme") || !params.hasOption("theme-folder")
                || !params.hasOption("version")) {
            // automatically generate the help statement
            HelpFormatter formatter = new HelpFormatter();
            formatter.printHelp(CompileTheme.class.getName(), options);
View Full Code Here

Examples of org.apache.commons.cli.PosixParser

  public static void main(String args[]) {

    try {
      System.out.println(args[0]);

      CommandLineParser parser = new PosixParser();
      CommandLine line = parser.parse(options, args);

      if (line.hasOption("cassandrahostip")) {
        CountandraUtils.setCassandraHostIp(line
            .getOptionValue("cassandrahostip"));
        if (line.hasOption("consistencylevel")) {
View Full Code Here

Examples of org.apache.commons.cli.PosixParser

    if(args.length == 0) {
      printUsage();
      return;
    }
   
    CommandLineParser parser = new PosixParser();
    CommandLine cmd;

    try {
      cmd = parser.parse(options, args);
    } catch (ParseException e) {
      System.out.println("Error parsing command-line options: ");
      printUsage();
      return;
    }
View Full Code Here

Examples of org.apache.commons.cli.PosixParser

  static final public void main(String args[]) {
    String port;
    Server server;
    SocketConnector connector;
    CommandLine cmd = null;
    CommandLineParser parser = new PosixParser();
    Options o = new Options();

    BasicConfigurator.configure();

    o.addOption("p", true, "port");
    try {
      cmd = parser.parse(o, args);
    }
    catch (ParseException exp ) {
      System.err.println( "Parsing failed.  Reason: " + exp.getMessage() );
      System.exit(-1);
    }
View Full Code Here

Examples of org.apache.commons.cli.PosixParser

    Options options = new Options();
    options.addOption("p", "port", true, "bind port");
    options.addOption("b", "base", true, "base path");
   
    try {
      CommandLine cl = new PosixParser().parse(options, args);
     
      int port = 8080;
      if (cl.hasOption('p')) {
        port = Integer.parseInt(cl.getOptionValue('p'));
      }
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.