diff options
author | bfredl <bjorn.linse@gmail.com> | 2023-01-31 19:58:33 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-01-31 19:58:33 +0100 |
commit | 8376486e8ff1722a0760443fc4a402bdea632dda (patch) | |
tree | 141fe889c2f2130d1084513a44399e482efba161 /src/nvim/main.c | |
parent | 8b11cf5092e0dfe45ee0f9cf0b72ce4ddeb8740c (diff) | |
parent | 13aa23b62af4df3e7f10687b76fe8c04efa2a598 (diff) | |
download | rneovim-8376486e8ff1722a0760443fc4a402bdea632dda.tar.gz rneovim-8376486e8ff1722a0760443fc4a402bdea632dda.tar.bz2 rneovim-8376486e8ff1722a0760443fc4a402bdea632dda.zip |
Merge pull request #17537 from bfredl/neolua
refactor(tests): run unittests using main nvim binary - delete separate nvim-test build
Diffstat (limited to 'src/nvim/main.c')
-rw-r--r-- | src/nvim/main.c | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/src/nvim/main.c b/src/nvim/main.c index bbe877356d..8df82c710a 100644 --- a/src/nvim/main.c +++ b/src/nvim/main.c @@ -239,6 +239,14 @@ int main(int argc, char **argv) argv0 = argv[0]; + if (argc > 1 && STRICMP(argv[1], "-ll") == 0) { + if (argc == 2) { + print_mainerr(err_arg_missing, argv[1]); + exit(1); + } + nlua_run_script(argv, argc, 3); + } + char *fname = NULL; // file name from command line mparm_T params; // various parameters passed between // main() and other functions. @@ -2111,6 +2119,12 @@ static int execute_env(char *env) static void mainerr(const char *errstr, const char *str) FUNC_ATTR_NORETURN { + print_mainerr(errstr, str); + os_exit(1); +} + +static void print_mainerr(const char *errstr, const char *str) +{ char *prgname = path_tail(argv0); signal_stop(); // kill us with CTRL-C here, if you like @@ -2126,8 +2140,6 @@ static void mainerr(const char *errstr, const char *str) os_errmsg(_("\nMore info with \"")); os_errmsg(prgname); os_errmsg(" -h\"\n"); - - os_exit(1); } /// Prints version information for "nvim -v" or "nvim --version". |