protected void parseCommandLine(String[] args) throws UnrecognizedOptionException, ParseException { CommandLineParser clp = new BasicParser(); try { cmd = clp.parse(getOptions(), args); } catch (UnrecognizedOptionException ux) { say("Error: unrecognized option + " + ux.getMessage()); say("Invoke with -help for more"); if (isVerbose()) { ux.printStackTrace(); } throw ux; } catch (ParseException e) { say("Error: could not parse a command line argument:" + e.getMessage()); if (isVerbose()) { e.printStackTrace(); } throw e; } }
protected void parseCommandLine(String[] args) { CommandLineParser clp = new BasicParser(); try { cmd = clp.parse(getOptions(), args); } catch (UnrecognizedOptionException ux) { String err = "Error: unrecognized option + " + ux.getMessage() ; say(err); say("Invoke with -help for more"); if (isVerbose()) { ux.printStackTrace(); } throw new GeneralException(err, ux); } catch (ParseException e) { String err= "Error: could not parse a command line argument:" + e.getMessage(); say(err); if (isVerbose()) { e.printStackTrace(); } throw new GeneralException(err,e); } }