Print correct help if core arguments (--input-file et al) aren't correctly specified.
git-svn-id: file:///humgen/gsa-scr1/gsa-engineering/svn_contents/trunk@244 348d0f76-0448-11de-a6fe-93d51630548a
This commit is contained in:
parent
3af4290a49
commit
7ee792df04
|
|
@ -269,17 +269,21 @@ public class ArgumentParser {
|
|||
* exit the program
|
||||
*
|
||||
* @param args the command line arguments we recieved
|
||||
* @param args whether to allow incomplete command-line arguments
|
||||
*/
|
||||
public void processArgs(String[] args, boolean allowUnrecognized) throws ParseException {
|
||||
public void processArgs(String[] args, boolean allowIncomplete) throws ParseException {
|
||||
OurPosixParser parser = new OurPosixParser();
|
||||
Collection<Option> opts = m_options.getOptions();
|
||||
|
||||
try {
|
||||
parser.parse(m_options, args, !allowUnrecognized);
|
||||
parser.parse(m_options, args, false);
|
||||
}
|
||||
catch (UnrecognizedOptionException e) {
|
||||
// we don't care about unknown exceptions right now
|
||||
if(!allowUnrecognized) {
|
||||
catch( ParseException e ) {
|
||||
boolean isIncomplete = e instanceof MissingArgumentException ||
|
||||
e instanceof MissingOptionException ||
|
||||
e instanceof UnrecognizedOptionException;
|
||||
|
||||
if( !(allowIncomplete && isIncomplete) ) {
|
||||
logger.warn(e.getMessage());
|
||||
throw e;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue