Prompt for Lua script or shell command in interactive session

This commit is contained in:
Vyacheslav Patkov 2024-06-01 17:31:22 +04:00 committed by Martin Lund
parent bb3636e2d5
commit f148a1413c
5 changed files with 28 additions and 5 deletions

View file

@ -535,7 +535,7 @@ void script_set_globals(lua_State *L)
script_set_global(L, "YMODEM", YMODEM);
}
void script_run(int fd)
void script_run(int fd, const char *script_filename)
{
lua_State *L;
@ -550,7 +550,12 @@ void script_run(int fd)
// Initialize globals
script_set_globals(L);
if (option.script_filename != NULL)
if (script_filename != NULL)
{
tio_printf("Running script %s", script_filename);
script_file_run(L, script_filename);
}
else if (option.script_filename != NULL)
{
tio_printf("Running script %s", option.script_filename);
script_file_run(L, option.script_filename);