private static CommandLine parseArg(String[] args) throws ParseException {
  Options options=new Options();
  options.addOption("h",false,"usage help");
  options.addOption("help",false,"usage help");
  options.addOption("f",true,"configuration file");
  options.addOption("l",true,"log file");
  options.addOption("w",true,"filter worker number");
  options.addOption("v",false,"print info log");
  options.addOption("vv",false,"print debug log");
  options.addOption("vvvv",false,"print trace log");
  CommandLineParser paraer=new BasicParser();
  CommandLine cmdLine=paraer.parse(options,args);
  if (cmdLine.hasOption("help") || cmdLine.hasOption("h")) {
    usage();
    System.exit(-1);
  }
  if (!cmdLine.hasOption("f")) {
    throw new IllegalArgumentException("Required -f argument to specify config file");
  }
  return cmdLine;
}

private static CommandLine parseArg ( String [ ] args ) throws ParseException { Options options = new Options ( ) ; options . addOption ( "h" , false , "usage help" ) ; options . addOption ( "help" , false , "usage help" ) ; options . addOption ( "f" , true , "configuration file" ) ; options . addOption ( "l" , true , "log file" ) ; options . addOption ( "w" , true , "filter worker number" ) ; options . addOption ( "v" , false , "print info log" ) ; options . addOption ( "vv" , false , "print debug log" ) ; options . addOption ( "vvvv" , false , "print trace log" ) ; CommandLineParser paraer = new BasicParser ( ) ; CommandLine cmdLine = paraer . parse ( options , args ) ; if ( cmdLine . hasOption ( "help" ) || cmdLine . hasOption ( "h" ) ) { usage ( ) ; System . exit ( - 1 ) ; } if ( ! cmdLine . hasOption ( "f" ) ) { throw new IllegalArgumentException ( "Required -f argument to specify config file" ) ; } return cmdLine ; }
parse the input command arguments
