If an option was given no value, throw an error

The previous behavior was to trigger a confusing assertion.
This commit is contained in:
John Wiegley 2009-02-14 04:35:22 -04:00
parent 7fb55eedef
commit 5290b6e8aa

View file

@ -106,7 +106,8 @@ public:
string& str() {
assert(handled);
assert(value);
if (! value)
throw_(std::runtime_error, "No argument provided for " << desc());
return value.as_string_lval();
}