diff options
author | John Wiegley <johnw@newartisans.com> | 2009-02-09 00:02:40 -0400 |
---|---|---|
committer | John Wiegley <johnw@newartisans.com> | 2009-02-09 00:02:40 -0400 |
commit | 76ab8cc083108c1407d7ce326821d3fbe9fbd2b9 (patch) | |
tree | 716b08402ee2f9ad6a29fbb4485241834190d04f /src | |
parent | f8a623d54777d675579e485a24f10bf24cc59cc3 (diff) | |
download | fork-ledger-76ab8cc083108c1407d7ce326821d3fbe9fbd2b9.tar.gz fork-ledger-76ab8cc083108c1407d7ce326821d3fbe9fbd2b9.tar.bz2 fork-ledger-76ab8cc083108c1407d7ce326821d3fbe9fbd2b9.zip |
Fixed an issue where --amount EXPR wasn't seeing that it had been "handled".
Diffstat (limited to 'src')
-rw-r--r-- | src/option.h | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/src/option.h b/src/option.h index 00f9d8d7..50ba238d 100644 --- a/src/option.h +++ b/src/option.h @@ -127,10 +127,15 @@ public: value = value_t(); } + virtual void handler_thunk(call_scope_t& args) {} + virtual void handler(call_scope_t& args) { if (wants_arg) - value = args[0]; - handled = true; + on(args[0]); + else + on(); + + handler_thunk(args); } virtual value_t handler_wrapper(call_scope_t& args) { @@ -164,8 +169,8 @@ public: name ## _option_t() : option_t<type>(#name), var(value) #define HELP(var) virtual void help(std::ostream& var) -#define DO() virtual void handler(call_scope_t&) -#define DO_(var) virtual void handler(call_scope_t& var) +#define DO() virtual void handler_thunk(call_scope_t&) +#define DO_(var) virtual void handler_thunk(call_scope_t& var) #define END(name) name ## _handler |