mirror of
https://github.com/neovim/neovim.git
synced 2025-09-29 14:38:32 +00:00
feat(lua): low-level interpreter mode (nvim -ll)
This commit is contained in:
@@ -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.
|
||||
@@ -2110,6 +2118,12 @@ static int execute_env(char *env)
|
||||
/// @param str string to append to the primary error message, or NULL
|
||||
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);
|
||||
|
||||
@@ -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".
|
||||
|
Reference in New Issue
Block a user