| 579 | } |
| 580 | |
| 581 | bool validate_bool(const cmdmap_t& cmdmap, |
| 582 | const arg_desc_t& desc, |
| 583 | const std::string_view name, |
| 584 | const std::string_view type, |
| 585 | std::ostream& os) |
| 586 | { |
| 587 | bool v; |
| 588 | try { |
| 589 | if (!cmd_getval(cmdmap, name, v)) { |
| 590 | if (auto req = desc.find("req"); |
| 591 | req != end(desc) && req->second == "false") { |
| 592 | return true; |
| 593 | } else { |
| 594 | os << "missing required parameter: '" << name << "'"; |
| 595 | return false; |
| 596 | } |
| 597 | } |
| 598 | return true; |
| 599 | } catch (const bad_cmd_get& e) { |
| 600 | return false; |
| 601 | } |
| 602 | } |
| 603 | |
| 604 | template<bool is_vector, |
| 605 | typename T, |
no test coverage detected