Skip to content

Commit 667f17a

Browse files
author
Robert James Oxspring
committed
ArgumentImpl now deals with defaults a little better
git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/cli/trunk@130092 13f79535-47bb-0310-9956-ffa450edef68
1 parent 94dff20 commit 667f17a

1 file changed

Lines changed: 1 addition & 6 deletions

File tree

src/java/org/apache/commons/cli2/option/ArgumentImpl.java

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ public void processValues(
146146
final ListIterator arguments,
147147
final Option option)
148148
throws OptionException {
149-
int argumentCount = commandLine.getValues(option).size();
149+
int argumentCount = commandLine.getValues(option,Collections.EMPTY_LIST).size();
150150
final int initialCount = argumentCount;
151151
while (arguments.hasNext() && argumentCount < maximum) {
152152

@@ -194,11 +194,6 @@ else if (subsequentSplit) {
194194
commandLine.addValue(option, allValues);
195195
}
196196
}
197-
198-
if (this.defaultValues == null
199-
&& (argumentCount < minimum || initialCount == argumentCount)) {
200-
throw new OptionException(option, "cli.error.missing.values");
201-
}
202197
}
203198

204199
public boolean canProcess(String arg) {

0 commit comments

Comments
 (0)