27 lines
489 B
Lua
27 lines
489 B
Lua
---@module 'uname'
|
|
local uname
|
|
uname = require'uname'
|
|
|
|
print(uname)
|
|
|
|
for k, v in pairs(uname) do
|
|
print(k, v)
|
|
end
|
|
|
|
print("numid", uname.numid(1))
|
|
do
|
|
local result, ret = xpcall(uname.numid, debug.traceback, "a", "b")
|
|
if not result then
|
|
io.stderr:write("error" .. ret .. "\n")
|
|
else
|
|
print("result: " .. ret)
|
|
end
|
|
end
|
|
|
|
print(type(uname.uname()))
|
|
print("uname")
|
|
for k, v in pairs(uname.uname()) do
|
|
print(k, v)
|
|
end
|
|
print("OS is " .. uname.uname().sysname)
|
|
|