diff --git a/src/main.cc b/src/main.cc index 027a32f8..cbbc9bee 100644 --- a/src/main.cc +++ b/src/main.cc @@ -914,6 +914,7 @@ int main(int argc, char* argv[]) { "l", { false, "list existing sessions" } }, { "clear", { false, "clear dead sessions" } }, { "debug", { true, "initial debug option value" } }, + { "version", { false, "display kakoune version and exit" } }, { "ro", { false, "readonly mode" } }, { "help", { false, "display a help message and quit" } } } }; @@ -945,6 +946,12 @@ int main(int argc, char* argv[]) if (show_help_message) return show_usage(); + if (parser.get_switch("version")) + { + write_stdout(format("Kakoune {}\n", Kakoune::version)); + return 0; + } + const bool list_sessions = (bool)parser.get_switch("l"); const bool clear_sessions = (bool)parser.get_switch("clear"); if (list_sessions or clear_sessions)