From e17430c1cd97db5624e27515a4f5da17f9d926d6 Mon Sep 17 00:00:00 2001 From: "Justin M. Keyes" Date: Sat, 7 Jan 2023 02:12:54 +0100 Subject: feat(lua): store "nvim -l" scriptname in _G.arg[0] --- runtime/doc/starting.txt | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'runtime') diff --git a/runtime/doc/starting.txt b/runtime/doc/starting.txt index fa9e23eb00..179bacdb24 100644 --- a/runtime/doc/starting.txt +++ b/runtime/doc/starting.txt @@ -218,15 +218,13 @@ argument. -l {script} [args] Executes Lua {script} non-interactively (no UI) with optional [args] after processing any preceding Nvim |cli-arguments|, - then exits. See |-S| to run multiple Lua scripts without args, - or in an interactive session. + then exits. Exits 1 on Lua error. See |-S| to run multiple Lua + scripts without args, with a UI. *lua-args* - All [args] are treated as {script} arguments and passed - literally to Lua (in the conventional `_G.arg` global table), - thus "-l" ends processing of Nvim arguments. + All [args] are treated as {script} arguments and stored in the + Lua `_G.arg` global table, thus "-l" ends processing of Nvim + arguments. The {script} name is stored at `_G.arg[0]`. - Exits with code 1 on Lua error. - Sets 'verbose' to 1 (like "-V1"), so Lua `print()` writes to output. -- cgit