From ea0eb66096ddc62758d613e9eae84b9d8b3061dc Mon Sep 17 00:00:00 2001 From: BanceDev Date: Sun, 8 Sep 2024 12:41:18 -0400 Subject: added support for cli args for lua scripts --- src/lush.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src/lush.c') diff --git a/src/lush.c b/src/lush.c index 69aa055..a3fbb93 100644 --- a/src/lush.c +++ b/src/lush.c @@ -127,8 +127,14 @@ int lush_time(lua_State *L, char ***args) { int lush_lua(lua_State *L, char ***args) { // run the lua file given - lua_load_script(L, args[0][0]); + const char *script = args[0][0]; + // move args forward to any command line args + args[0]++; + + lua_load_script(L, script, args[0]); + // return pointer back to lua file + args[0]--; return 1; } -- cgit v1.2.3-59-g8ed1b