summaryrefslogtreecommitdiff
path: root/src/option.h
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2009-02-19 14:26:08 -0400
committerJohn Wiegley <johnw@newartisans.com>2009-02-19 14:26:08 -0400
commit39bdbbe053c5d9c6268672d2017bc5da299ec1b7 (patch)
tree6ffbda35a06da91c0f8b60bfe6d30d3be4a3055a /src/option.h
parent7d1f125fa218f9405511a5a95b3a17718bff7c7a (diff)
downloadfork-ledger-39bdbbe053c5d9c6268672d2017bc5da299ec1b7.tar.gz
fork-ledger-39bdbbe053c5d9c6268672d2017bc5da299ec1b7.tar.bz2
fork-ledger-39bdbbe053c5d9c6268672d2017bc5da299ec1b7.zip
The sequence -M -p 2004 now equals -p 2004 -M
Diffstat (limited to 'src/option.h')
-rw-r--r--src/option.h15
1 files changed, 5 insertions, 10 deletions
diff --git a/src/option.h b/src/option.h
index 5abc312f..d7aeba1b 100644
--- a/src/option.h
+++ b/src/option.h
@@ -119,18 +119,13 @@ public:
return value.as_string_lval();
}
- void on() {
+ void on_only() {
handled = true;
}
- void on(const char * str) {
- handled = true;
- value = string_value(str);
- }
void on(const string& str) {
- handled = true;
- value = string_value(str);
+ on_with(string_value(str));
}
- void on(const value_t& val) {
+ virtual void on_with(const value_t& val) {
handled = true;
value = val;
}
@@ -146,9 +141,9 @@ public:
if (wants_arg) {
if (args.empty())
throw_(std::runtime_error, "No argument provided for " << desc());
- on(args[0]);
+ on_with(args[0]);
} else {
- on();
+ on_only();
}
handler_thunk(args);