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/main.cc | |
| parent | c0bc7b6644076d1cb6c387ef29a9ad3c8d8acd67 (diff) | |
Catch parameter errors on startup and display option informations
Diffstat (limited to 'src/main.cc')
| -rw-r--r-- | src/main.cc | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/main.cc b/src/main.cc index 4a8421dc..721ee933 100644 --- a/src/main.cc +++ b/src/main.cc @@ -362,6 +362,18 @@ int main(int argc, char* argv[]) kakoune(params); } + catch (Kakoune::parameter_error& error) + { + printf("Error: %s\n" + "Valid options:\n" + " -e <commands>: execute commands on initialisation\n" + " -c <session>: connect to the given session\n" + " -s <session>: set session name\n" + " -d: run as a headless session (requires -s)\n" + " -n: do not source kakrc files on startup\n", + error.what()); + return -1; + } catch (Kakoune::exception& error) { on_assert_failed(("uncaught exception:\n"_str + error.what()).c_str()); |
