diff options
| author | Maxime Coste <frrrwww@gmail.com> | 2014-01-23 19:36:07 +0000 |
|---|---|---|
| committer | Maxime Coste <frrrwww@gmail.com> | 2014-01-23 19:36:07 +0000 |
| commit | cccb07c7cd4faeb391547200bf3143d58f9c15ab (patch) | |
| tree | fd4caa267a70059c77193f48712f31e18d613821 /src/parameters_parser.hh | |
| parent | c0bc7b6644076d1cb6c387ef29a9ad3c8d8acd67 (diff) | |
Catch parameter errors on startup and display option informations
Diffstat (limited to 'src/parameters_parser.hh')
| -rw-r--r-- | src/parameters_parser.hh | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/src/parameters_parser.hh b/src/parameters_parser.hh index 2f7e5477..2230e3f2 100644 --- a/src/parameters_parser.hh +++ b/src/parameters_parser.hh @@ -12,21 +12,26 @@ namespace Kakoune using ParameterList = memoryview<String>; -struct unknown_option : public runtime_error +struct parameter_error : public runtime_error +{ + using runtime_error::runtime_error; +}; + +struct unknown_option : public parameter_error { unknown_option(const String& name) - : runtime_error("unknown option '" + name + "'") {} + : parameter_error("unknown option '" + name + "'") {} }; -struct missing_option_value: public runtime_error +struct missing_option_value: public parameter_error { missing_option_value(const String& name) - : runtime_error("missing value for option '" + name + "'") {} + : parameter_error("missing value for option '" + name + "'") {} }; -struct wrong_argument_count : runtime_error +struct wrong_argument_count : public parameter_error { - wrong_argument_count() : runtime_error("wrong argument count") {} + wrong_argument_count() : parameter_error("wrong argument count") {} }; using OptionMap = std::unordered_map<String, bool>; |
