| 108 | } |
| 109 | |
| 110 | bool parse_bool_option(const std::string & value, std::string_view key) { |
| 111 | if (value == "true" || value == "1" || value == "yes" || value == "on") { |
| 112 | return true; |
| 113 | } |
| 114 | if (value == "false" || value == "0" || value == "no" || value == "off") { |
| 115 | return false; |
| 116 | } |
| 117 | throw std::runtime_error(std::string(key) + " must be true/false, yes/no, on/off, or 1/0"); |
| 118 | } |
| 119 | |
| 120 | std::optional<int> parse_int_option( |
| 121 | const std::unordered_map<std::string, std::string> & options, |
no test coverage detected