mirror of
https://github.com/CLIUtils/CLI11.git
synced 2025-05-02 05:33:53 +00:00
Revert change for now, add helper function
This commit is contained in:
parent
f59570328a
commit
cef5dfa58d
@ -1064,6 +1064,19 @@ class App {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Count the required remaining positional arguments
|
||||||
|
size_t _count_remaining_required_positionals() const {
|
||||||
|
size_t retval = 0;
|
||||||
|
for(const Option_p &opt : options_)
|
||||||
|
if(opt->get_positional()
|
||||||
|
&& opt->get_required()
|
||||||
|
&& opt->get_expected() > 0
|
||||||
|
&& static_cast<int>(opt->count()) < opt->get_expected())
|
||||||
|
retval = static_cast<size_t>(opt->get_expected()) - opt->count();
|
||||||
|
|
||||||
|
return retval;
|
||||||
|
}
|
||||||
|
|
||||||
/// Parse a positional, go up the tree to check
|
/// Parse a positional, go up the tree to check
|
||||||
void _parse_positional(std::vector<std::string> &args) {
|
void _parse_positional(std::vector<std::string> &args) {
|
||||||
|
|
||||||
@ -1080,7 +1093,7 @@ class App {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(parent_ != nullptr && fallthrough_)
|
if(parent_ != nullptr)// TODO && fallthrough_)
|
||||||
return parent_->_parse_positional(args);
|
return parent_->_parse_positional(args);
|
||||||
else {
|
else {
|
||||||
args.pop_back();
|
args.pop_back();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user