| 546 | } |
| 547 | |
| 548 | static bool isOptionSet(PatternList const& options, std::string const& opt1, std::string const& opt2 = "") { |
| 549 | return std::any_of(options.begin(), options.end(), [&](std::shared_ptr<Pattern const> const& opt) -> bool { |
| 550 | auto const& name = opt->name(); |
| 551 | if (name==opt1 || (!opt2.empty() && name==opt2)) { |
| 552 | return opt->hasValue(); |
| 553 | } |
| 554 | return false; |
| 555 | }); |
| 556 | } |
| 557 | |
| 558 | static void extras(bool help, bool version, PatternList const& options) { |
| 559 | if (help && isOptionSet(options, "-h", "--help")) { |