From 39bdbbe053c5d9c6268672d2017bc5da299ec1b7 Mon Sep 17 00:00:00 2001 From: John Wiegley Date: Thu, 19 Feb 2009 14:26:08 -0400 Subject: The sequence -M -p 2004 now equals -p 2004 -M --- src/option.h | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) (limited to 'src/option.h') 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); -- cgit v1.2.3