summaryrefslogtreecommitdiff
path: root/src/option.h
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2009-02-14 04:35:22 -0400
committerJohn Wiegley <johnw@newartisans.com>2009-02-14 04:35:22 -0400
commit5290b6e8aa2c81011a32d1cea807c93c30147a50 (patch)
tree083388b8b5121804d89014a463d0542a1589ed6d /src/option.h
parent7fb55eedef20cdddaba7ca0a7236240bdc20fa46 (diff)
downloadfork-ledger-5290b6e8aa2c81011a32d1cea807c93c30147a50.tar.gz
fork-ledger-5290b6e8aa2c81011a32d1cea807c93c30147a50.tar.bz2
fork-ledger-5290b6e8aa2c81011a32d1cea807c93c30147a50.zip
If an option was given no value, throw an error
The previous behavior was to trigger a confusing assertion.
Diffstat (limited to 'src/option.h')
-rw-r--r--src/option.h3
1 files changed, 2 insertions, 1 deletions
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();
}