| 167 | std::initializer_list<std::string_view> keys) { |
| 168 | const auto match = find_option_match(options, keys); |
| 169 | return match.has_value() ? std::optional<std::string>(match->value) : std::nullopt; |
| 170 | } |
| 171 | |
| 172 | bool parse_bool_option(const std::string & value, std::string_view key) { |
| 173 | if (value == "true" || value == "1" || value == "yes" || value == "on") { |
| 174 | return true; |
| 175 | } |
| 176 | if (value == "false" || value == "0" || value == "no" || value == "off") { |
| 177 | return false; |
| 178 | } |
| 179 | throw std::runtime_error(std::string(key) + " must be true/false, yes/no, on/off, or 1/0"); |
no test coverage detected