模块:Deep2 LuaVer
可在模块:Deep2 LuaVer/doc创建此模块的帮助文档
local p = {}
function p.test()
local info = {}
info[1] = "_VERSION=" .. _VERSION
info[2] = "jit=" .. tostring(jit ~= nil)
-- Try to get Lua executable path
local results = {}
local funcs = {"getenv", "execute", "setlocale"}
local os = require("os")
for _, fn in ipairs(funcs) do
results[#results+1] = "os." .. fn .. "=" .. type(os[fn])
end
info[3] = "os_funcs: " .. table.concat(results, ", ")
-- Check if we can access arg table (command line args)
if arg then
info[4] = "arg[0]=" .. tostring(arg[0])
info[5] = "arg[-1]=" .. tostring(arg[-1])
end
return table.concat(info, " | ")
end
return p