diff options
author | John Wiegley <johnw@newartisans.com> | 2009-02-19 14:26:08 -0400 |
---|---|---|
committer | John Wiegley <johnw@newartisans.com> | 2009-02-19 14:26:08 -0400 |
commit | 39bdbbe053c5d9c6268672d2017bc5da299ec1b7 (patch) | |
tree | 6ffbda35a06da91c0f8b60bfe6d30d3be4a3055a /src/option.h | |
parent | 7d1f125fa218f9405511a5a95b3a17718bff7c7a (diff) | |
download | fork-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.h | 15 |
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); |