Skip to content

Commit 7e6dedb

Browse files
author
John Keyes
committed
throw an exception if a value is attempted to be added to an Option that does not have any argument values
git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/cli/trunk@129853 13f79535-47bb-0310-9956-ffa450edef68
1 parent 5470bca commit 7e6dedb

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/java/org/apache/commons/cli/Option.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -396,7 +396,7 @@ void addValue( String value )
396396
{
397397
switch( numberOfArgs ) {
398398
case UNINITIALIZED:
399-
break;
399+
throw new RuntimeException( "Cannot add value, no arguments allowed." );
400400
default:
401401
processValue( value );
402402
}

0 commit comments

Comments
 (0)