Fix greediness of greedy arguments if they have sub arguments
Even sub arguments (e.g. `--help`) should be treated as values to be passed to a nested argument parser (as documented). The sub arguments are only added in this case to appear in the help.
This commit is contained in:
parent
5bfce4235e
commit
66b6fff0f2
|
@ -361,6 +361,9 @@ bool ArgumentReader::read(ArgumentVector &args)
|
|||
++parser.m_actualArgc;
|
||||
lastArg = lastArgInLevel = matchingArg;
|
||||
argDenotation = nullptr;
|
||||
if ((values->size() < matchingArg->requiredValueCount()) && (matchingArg->flags() & Argument::Flags::Greedy)) {
|
||||
continue;
|
||||
}
|
||||
read(lastArg->m_subArgs);
|
||||
argDenotation = nullptr;
|
||||
continue;
|
||||
|
|
Loading…
Reference in New Issue