Fixed an issue where --amount EXPR wasn't seeing that it had been "handled".
This commit is contained in:
parent
f8a623d547
commit
76ab8cc083
1 changed files with 9 additions and 4 deletions
13
src/option.h
13
src/option.h
|
|
@ -127,10 +127,15 @@ public:
|
||||||
value = value_t();
|
value = value_t();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
virtual void handler_thunk(call_scope_t& args) {}
|
||||||
|
|
||||||
virtual void handler(call_scope_t& args) {
|
virtual void handler(call_scope_t& args) {
|
||||||
if (wants_arg)
|
if (wants_arg)
|
||||||
value = args[0];
|
on(args[0]);
|
||||||
handled = true;
|
else
|
||||||
|
on();
|
||||||
|
|
||||||
|
handler_thunk(args);
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual value_t handler_wrapper(call_scope_t& args) {
|
virtual value_t handler_wrapper(call_scope_t& args) {
|
||||||
|
|
@ -164,8 +169,8 @@ public:
|
||||||
name ## _option_t() : option_t<type>(#name), var(value)
|
name ## _option_t() : option_t<type>(#name), var(value)
|
||||||
|
|
||||||
#define HELP(var) virtual void help(std::ostream& var)
|
#define HELP(var) virtual void help(std::ostream& var)
|
||||||
#define DO() virtual void handler(call_scope_t&)
|
#define DO() virtual void handler_thunk(call_scope_t&)
|
||||||
#define DO_(var) virtual void handler(call_scope_t& var)
|
#define DO_(var) virtual void handler_thunk(call_scope_t& var)
|
||||||
|
|
||||||
#define END(name) name ## _handler
|
#define END(name) name ## _handler
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue