Skip to content

Commit

Permalink
added a check to make sure we jump out of the parse method, fixes #352
Browse files Browse the repository at this point in the history
  • Loading branch information
stalep committed Feb 8, 2025
1 parent b139d5a commit 517feb2
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,13 @@ public void parse(ParsedLineIterator parsedLineIterator, ProcessedOption option)
while(status != Status.NULL && parsedLineIterator.hasNextWord()) {
String word = parsedLineIterator.peekWord();
ProcessedOption nextOption = option.parent().searchAllOptions(word);
if(nextOption == null)
if(nextOption == null) {
doParse(parsedLineIterator, option);
if (status == null && !option.hasValue()) {
//this might happen if we have an option at the "end" that doesn't accept values
return;
}
}
//we have something like: --foo --bar eg, two options after another
else {
//TODO: we need to do something better here
Expand Down

0 comments on commit 517feb2

Please sign in to comment.