public RulesMainCLI(String[] args)
  {
    if (args.length < 1)
    {
      System.out.println(HEADER);
      System.out.println(FOOTER);
      System.out.println("Use -h or --help for command line options.");
      return;
    }

    CommandLine cl = null;
    Options options = new Options();
    options.addOption("p", "path", true, "Base path for the rule set");
    options.addOption("o", "output", true, "File to write output XML");
    options.addOption("r", "request", true, "Request to process against the rules");
    options.addOption("h", "help", false, "Help");
    options.addOption("l", "logging-level", true, "Logging level (0-disabled, 1-errors, 2-events, 3-warnings, 4-info, 5-debug)");
    CommandLineParser parser = new GnuParser();
    try
    {
      cl = parser.parse(options, args);
    }
    catch(Exception e)
    {
      logger.error("Failed to parse command line.", e);
      System.err.println("Failed to parse command line." + e);
      return;
    }

    // Display help if requested
    if (cl.hasOption('h'))
    {
      HelpFormatter formatter = new HelpFormatter();
      formatter.printHelp("do.sh", HEADER, options, FOOTER);
      return;
    }

    // Process command line input
    loggingLevel = Integer.parseInt(cl.getOptionValue("l","1"));
    if (loggingLevel < 0 || loggingLevel > 5)
    {
      System.out.println("Logging level of ("+loggingLevel+") is not valid, defaulting to 1");
      loggingLevel = 1;
    }
    String[] basePaths = cl.getOptionValues('p');
    if (null == basePaths)
    {
      System.err.println("Base path (-p) is required");
      return;
    }
    basePath = basePaths[0];
    
    String[] requestPaths = cl.getOptionValues('r');
    if (null == requestPaths)
    {
      System.err.println("Request (-r) is required");
      return;
    }
    requestPath = requestPaths[0];
    
    String[] outputPaths = cl.getOptionValues('o');
    if (null != outputPaths)
    {
      outputPath = outputPaths[0];
    }
  }