- bool found = false;
- for (auto kv : valid_values) {
- if (kv.first == val)
- found = true;
- }
- if (not found || std::string(val) == "help") {
- std::string mesg = "\n";
- if (std::string(val) == "help")
- mesg += std::string("Possible values for option ") + name + ":\n";
- else
- mesg += std::string("Invalid value '") + val + "' for option " + name + ". Possible values:\n";
- for (auto kv : valid_values)
- mesg += " - '" + std::string(kv.first) + "': " + kv.second +
- (kv.first == value ? " <=== DEFAULT" : "") + "\n";
- xbt_die("%s", mesg.c_str());