| 611 | } |
| 612 | |
| 613 | bool OSRunner::getBoolArgumentValue(const std::string& argument_name, const std::map<std::string, OSArgument>& user_arguments) { |
| 614 | std::stringstream ss; |
| 615 | |
| 616 | auto it = user_arguments.find(argument_name); |
| 617 | if (it != user_arguments.end()) { |
| 618 | if (it->second.hasValue()) { |
| 619 | return it->second.valueAsBool(); |
| 620 | } else if (it->second.hasDefaultValue()) { |
| 621 | return it->second.defaultValueAsBool(); |
| 622 | } |
| 623 | } |
| 624 | |
| 625 | ss << "No value found for argument '" << argument_name << "'."; |
| 626 | if (it != user_arguments.end()) { |
| 627 | ss << " Full argument as passed in by user:" << '\n' << it->second; |
| 628 | } |
| 629 | registerError(ss.str()); |
| 630 | LOG_AND_THROW(ss.str()); |
| 631 | return false; |
| 632 | } |
| 633 | |
| 634 | boost::optional<bool> OSRunner::getOptionalBoolArgumentValue(const std::string& argument_name, |
| 635 | const std::map<std::string, OSArgument>& user_arguments) { |