From 5290b6e8aa2c81011a32d1cea807c93c30147a50 Mon Sep 17 00:00:00 2001 From: John Wiegley Date: Sat, 14 Feb 2009 04:35:22 -0400 Subject: If an option was given no value, throw an error The previous behavior was to trigger a confusing assertion. --- src/option.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/option.h b/src/option.h index 787d34ae..639f049b 100644 --- a/src/option.h +++ b/src/option.h @@ -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(); } -- cgit v1.2.3