Examples of GnuParser


Examples of com.facebook.presto.hive.shaded.org.apache.commons.cli.GnuParser

  }

  public static void main(String[] args) {
    HiveMetaTool metaTool = new HiveMetaTool();
    metaTool.init();
    CommandLineParser parser = new GnuParser();
    CommandLine line = null;

    try {
      try {
        line = parser.parse(metaTool.cmdLineOptions, args);
      } catch (ParseException e) {
        System.err.println("HiveMetaTool:Parsing failed.  Reason: " + e.getLocalizedMessage());
        printAndExit(metaTool);
      }
View Full Code Here

Examples of org.apache.commons.cli.GnuParser

    createOptions();

        // set up array to return for public access to cmd line args
        _rawArgs = args;       

    final CommandLineParser parser = new GnuParser();
    try
    {
      _cmdLine = parser.parse(_options, args);
    }
    catch(ParseException ex)
    {
      System.err.println("Parsing failed. Reason: " + ex.getMessage());
      printHelp();
View Full Code Here

Examples of org.apache.commons.cli.GnuParser

      options.addOption(optSourceFile);
      options.addOption(optTargetFile);
      options.addOption(optLogLevel);
      options.addOption(optChangeUser);
     
      CommandLineParser parser = new GnuParser();
      CommandLine line=null;
      try{
        line = parser.parse(options, args);
      } catch(Exception e){
        HelpFormatter formatter = new HelpFormatter();
        formatter.printHelp("cronconverter", options, true);
        System.exit(0);
      }
View Full Code Here

Examples of org.apache.commons.cli.GnuParser

    options.addOption(opt);
    options.addOption(opt);
    opt = new Option("t", true, "capacity of the channel");
    opt.setRequired(true);
    options.addOption(opt);
    CommandLineParser parser = new GnuParser();
    CommandLine cli = parser.parse(options, args);
    File checkpointDir = new File(cli.getOptionValue("c"));
    String[] logDirs = cli.getOptionValue("l").split(",");
    List<File> logFiles = Lists.newArrayList();
    for (String logDir : logDirs) {
      File[] files = new File(logDir).listFiles();
View Full Code Here

Examples of org.apache.commons.cli.GnuParser

        .addOption(null, "dirname", true, "directory to stream to avro source")
        .addOption("R", "headerFile", true, ("file containing headers as " +
            "key/value pairs on each new line"))
        .addOption("h", "help", false, "display help text");

    CommandLineParser parser = new GnuParser();
    CommandLine commandLine = parser.parse(options, args);

    if (commandLine.hasOption('h')) {
      new HelpFormatter().printHelp("flume-ng avro-client", "", options,
          "The --dirname option assumes that a spooling directory exists " +
          "where immutable log files are dropped.", true);
View Full Code Here

Examples of org.apache.commons.cli.GnuParser

        opt = new Option(APP_PORT, true, "Application Port");
        opt.setRequired(false);
        options.addOption(opt);

        return new GnuParser().parse(options, args);
    }
View Full Code Here

Examples of org.apache.commons.cli.GnuParser

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

        CommandLine line = parser.parse( options, args );
        File dir = new File(line.getOptionValue("dir", "."));
        Collection files = ListFile.list(dir);
        System.out.println("listing files in "+dir);
        for (Iterator it = files.iterator(); it.hasNext(); ) {
          System.out.println("\t"+it.next()+"\n");
View Full Code Here

Examples of org.apache.commons.cli.GnuParser

                "backup repository directory (jackrabbit-backupN)");
        options.addOption(
                "C", "backup-conf", true,
                "backup repository configuration file");

        command = new GnuParser().parse(options, args);
    }
View Full Code Here

Examples of org.apache.commons.cli.GnuParser

      return _usage;
    }

    public boolean processCommandLineArgs(String[] cliArgs) throws IOException, DatabusException
    {
      CommandLineParser cliParser = new GnuParser();
      _cmd = null;

      try
      {
        _cmd = cliParser.parse(_cliOptions, cliArgs);
      } catch (ParseException pe)
      {
        System.err.println(NAME + ": failed to parse command-line options: " + pe.toString());
        printCliHelp();
        return false;
View Full Code Here

Examples of org.apache.commons.cli.GnuParser

    _options.addOption(verboseOption);
  }

  public void parseCommandLine(String[] args) throws ParseException
  {
    GnuParser cmdLineParser = new GnuParser();
    _cmdLine = cmdLineParser.parse(_options, args);
  }
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.