Skip to content

Commit

Permalink
We now treat options that *can* have arguments but have none as being…
Browse files Browse the repository at this point in the history
… set to "" instead of `null` (ceylon/ceylon-runtime#26)
  • Loading branch information
quintesse committed Oct 2, 2013
1 parent 894a28d commit 0f48d25
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/com/redhat/ceylon/common/tool/ToolFactory.java
Original file line number Diff line number Diff line change
Expand Up @@ -162,11 +162,15 @@ void processArguments() {
case OPTIONAL:
case REQUIRED:
argument = getLongFormArgument(arg, iter);
if (argument == null && option.getArgumentType() == ArgumentType.REQUIRED) {
if (iter.hasNext()) {
argument = iter.next();
if (argument == null) {
if (option.getArgumentType() == ArgumentType.REQUIRED) {
if (iter.hasNext()) {
argument = iter.next();
} else {
throw new OptionArgumentException.OptionWithoutArgumentException(option, arg);
}
} else {
throw new OptionArgumentException.OptionWithoutArgumentException(option, arg);
argument = "";
}
}
break;
Expand Down

0 comments on commit 0f48d25

Please sign in to comment.