Permalink
Browse files

Fix concatenated boolean option handling -- this problem was caused b…

…y a conflict between the patch for that functionality, and the patch for the multiple options functionality.
  • Loading branch information...
Ewan Mellor
Ewan Mellor committed Apr 9, 2005
1 parent 7221452 commit 43fdaec19d0e95eea07202c7cd5a4bcd75302682
Showing with 6 additions and 7 deletions.
  1. +6 −7 src/jargs/gnu/CmdLineParser.java
@@ -34,7 +34,7 @@
*/
public static class UnknownOptionException extends OptionException {
UnknownOptionException( String optionName ) {
- this(optionName, "unknown option '" + optionName + "'");
+ this(optionName, "Unknown option '" + optionName + "'");
}
UnknownOptionException( String optionName, String msg ) {
@@ -61,7 +61,7 @@
private char suboption;
UnknownSuboptionException( String option, char suboption ) {
- super(option, "illegal option: '"+suboption+"' in '"+option+"'");
+ super(option, "Illegal option: '"+suboption+"' in '"+option+"'");
this.suboption=suboption;
}
public char getSuboption() { return suboption; }
@@ -78,7 +78,7 @@
private char notflag;
NotFlagException( String option, char unflaggish ) {
- super(option, "illegal option: '"+option+"', '"+
+ super(option, "Illegal option: '"+option+"', '"+
unflaggish+"' requires a value");
notflag=unflaggish;
}
@@ -97,7 +97,7 @@
*/
public static class IllegalOptionValueException extends OptionException {
public IllegalOptionValueException( Option opt, String value ) {
- super("illegal value '" + value + "' for option " +
+ super("Illegal value '" + value + "' for option " +
(opt.shortForm() != null ? "-" + opt.shortForm() + "/" : "") +
"--" + opt.longForm());
this.option = opt;
@@ -133,7 +133,7 @@ protected Option( char shortForm, String longForm,
private Option( String shortForm, String longForm, boolean wantsValue ) {
if ( longForm == null )
- throw new IllegalArgumentException("null arg forms not allowed");
+ throw new IllegalArgumentException("Null longForm not allowed");
this.shortForm = shortForm;
this.longForm = longForm;
this.wantsValue = wantsValue;
@@ -463,8 +463,7 @@ public final void parse( String[] argv, Locale locale )
UnknownSuboptionException(curArg,curArg.charAt(i));
if(opt.wantsValue()) throw new
NotFlagException(curArg,curArg.charAt(i));
- this.values.put(opt.longForm(),
- opt.getValue(null,locale));
+ addValue(opt, opt.getValue(null,locale));
}
position++;

0 comments on commit 43fdaec

Please sign in to comment.