feat(lua): send "--" literally to Lua "-l" script

Problem:
When "-l" is followed by "--", we stop sending args to the Lua script
and treat "--" in the usual way. This was for flexibility but didn't
have a strong use-case, and has these problems:
- prevents Lua "-l" scripts from handling "--" in their own way.
- complicates the startup logic (must call nlua_init before command_line_scan)

Solution:
Don't treat "--" specially if it follows "-l".
This commit is contained in:
Justin M. Keyes
2023-01-01 03:14:13 +01:00
parent 599e1d019a
commit 45549f031e
7 changed files with 74 additions and 53 deletions

View File

@@ -24,6 +24,7 @@ typedef struct {
int n_pre_commands; // no. of commands from --cmd
char *pre_commands[MAX_ARG_CMDS]; // commands from --cmd argument
char *luaf; // Lua script filename from "-l"
int lua_arg0; // Lua script args start index.
int edit_type; // type of editing to do
char *tagname; // tag from -t argument