summaryrefslogtreecommitdiff
path: root/option.h
diff options
context:
space:
mode:
Diffstat (limited to 'option.h')
-rw-r--r--option.h11
1 files changed, 4 insertions, 7 deletions
diff --git a/option.h b/option.h
index 1acc20e9..75990d1b 100644
--- a/option.h
+++ b/option.h
@@ -5,6 +5,8 @@
#include <string>
#include <exception>
+#include "error.h"
+
typedef void (*handler_t)(const char * arg);
struct option_t {
@@ -15,15 +17,10 @@ struct option_t {
bool handled;
};
-class option_error : public std::exception {
- std::string reason;
+class option_error : public error {
public:
- option_error(const std::string& _reason) throw() : reason(_reason) {}
+ option_error(const std::string& reason) throw() : error(reason) {}
virtual ~option_error() throw() {}
-
- virtual const char* what() const throw() {
- return reason.c_str();
- }
};
bool process_option(option_t * options, const std::string& opt,