mirror of
https://github.com/tio/tio.git
synced 2026-05-01 14:57:59 +02:00
Prompt for Lua script or shell command in interactive session
This commit is contained in:
parent
bb3636e2d5
commit
f148a1413c
5 changed files with 28 additions and 5 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue