| 267 | }; |
| 268 | |
| 269 | std::string extract_single_value(std::string const& input, |
| 270 | ParseMode& parseState) const |
| 271 | { |
| 272 | // parse the string to get the value |
| 273 | auto possible_value = cm::string_view(input).substr(this->Name.size()); |
| 274 | if (possible_value.empty()) { |
| 275 | parseState = ParseMode::ValueError; |
| 276 | } else if (possible_value[0] == '=') { |
| 277 | possible_value.remove_prefix(1); |
| 278 | if (possible_value.empty()) { |
| 279 | parseState = ParseMode::ValueError; |
| 280 | } |
| 281 | } |
| 282 | if (parseState == ParseMode::Valid && possible_value[0] == ' ') { |
| 283 | possible_value.remove_prefix(1); |
| 284 | } |
| 285 | return std::string(possible_value); |
| 286 | } |
| 287 | |
| 288 | static bool IsFlag(cm::string_view arg) |
| 289 | { |