diff options
-rw-r--r-- | src/libutil/config.cc | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/libutil/config.cc b/src/libutil/config.cc index 2f9f988607ea..893cdccce344 100644 --- a/src/libutil/config.cc +++ b/src/libutil/config.cc @@ -90,7 +90,12 @@ template<> std::string Setting<int>::to_string() template<> void Setting<bool>::set(const std::string & str) { - value = str == "true" || str == "1"; + if (str == "true" || str == "yes" || str == "1") + value = true; + else if (str == "false" || str == "no" || str == "0") + value = false; + else + throw UsageError("Boolean setting '%s' has invalid value '%s'", name, str); } template<> std::string Setting<bool>::to_string() |