Skip to content

Commit 517feb2

Browse files
committed
added a check to make sure we jump out of the parse method, fixes #352
1 parent b139d5a commit 517feb2

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

aesh/src/main/java/org/aesh/command/impl/parser/AeshOptionParser.java

+6-1
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,13 @@ public void parse(ParsedLineIterator parsedLineIterator, ProcessedOption option)
4444
while(status != Status.NULL && parsedLineIterator.hasNextWord()) {
4545
String word = parsedLineIterator.peekWord();
4646
ProcessedOption nextOption = option.parent().searchAllOptions(word);
47-
if(nextOption == null)
47+
if(nextOption == null) {
4848
doParse(parsedLineIterator, option);
49+
if (status == null && !option.hasValue()) {
50+
//this might happen if we have an option at the "end" that doesn't accept values
51+
return;
52+
}
53+
}
4954
//we have something like: --foo --bar eg, two options after another
5055
else {
5156
//TODO: we need to do something better here

0 commit comments

Comments
 (0)