Files
opus-apps/shellex/hostname.lua
kepler155c@gmail.com 86cba3b585 shell tools: globbing
2019-05-10 08:08:49 -04:00

18 lines
313 B
Lua

local os = _G.os
local shell = require("shellex.shell")
local args = shell.parse(...)
local hostname = args[1]
if hostname then
os.setComputerLabel(hostname)
else
hostname = os.getComputerLabel()
if hostname then
print(hostname)
else
io.stderr:write("Hostname not set\n")
return 1
end
end