diff --git a/main.c b/main.c index f3d6f96..94f67e3 100644 --- a/main.c +++ b/main.c @@ -214,7 +214,8 @@ int initialize_everything(char* lua_file) { OCT_LOG_INFO("Begin running oct_init()"); lua_getglobal(L, "oct_init"); lua_pushstring(L, lua_args); - if (lua_pcall(L, 1, 2, 0) != LUA_OK) { + lua_pushinteger(L, atoi(config.port)); + if (lua_pcall(L, 2, 2, 0) != LUA_OK) { OCT_LOG_ERROR("%s", luaL_checkstring(L, -1)); deinitialize_everything(); return 0; diff --git a/test_args.lua b/test_oct_init.lua similarity index 77% rename from test_args.lua rename to test_oct_init.lua index 527439b..26f1ddf 100644 --- a/test_args.lua +++ b/test_oct_init.lua @@ -1,8 +1,9 @@ require("oct_utils") require("termbox_defs") -function oct_init(args) +function oct_init(args, port) OCT_LOG_ERROR("Starting oct_init") + OCT_LOG_ERROR("Port: " .. port) OCT_LOG_ERROR("Received args: " .. args) return OCT_NOT_NEEDS_NETWORKING, OCT_NOT_NEEDS_TERMBOX end