Ejemplo n.º 1
0
 public boolean processOptions(String[] args) {
   CommandLineParser parser = new PosixParser();
   try {
     cli = parser.parse(options, args);
   } catch (ParseException e) {
     Log.error(this, "Command line parse failure: " + e.getMessage());
     return false;
   }
   return !hasUnrecognized();
 }
Ejemplo n.º 2
0
 private boolean hasUnrecognized() {
   // after parsing, getArgs returns only unrecognized
   if (argCount() == 0) return false;
   if (argCount() == 1) {
     if (cli.getArgs()[0].endsWith(GenConfig.configFileSuffix)) {
       this.configName = cli.getArgs()[0];
       return false;
     }
   }
   Log.warn(this, "Unrecognized Options: " + cli.getArgList().toString());
   printUsage();
   return true;
 }