2017-10-07 23:33:00 +11:00
|
|
|
local tA = {...}
|
2017-10-08 01:35:18 +11:00
|
|
|
local si = tA[1] or os.getenv("sI")
|
|
|
|
os.setenv("sI",si)
|
|
|
|
_ENV = shutil.genenv()
|
|
|
|
print("lush v1/".._VERSION)
|
|
|
|
os.setenv("PSF",function()
|
|
|
|
local ps = "["..os.getuid().."@"..net.id.." "..(os.getenv("PWD") or "").."]"
|
|
|
|
if os.getuid() == "superuser" then ps = ps .. "# " else ps = ps .. "$ " end
|
|
|
|
return ps end)
|
|
|
|
while true do
|
|
|
|
local didexec = false
|
|
|
|
write(os.getenv("PSF")())
|
|
|
|
local inp=readln()
|
|
|
|
if not inp then break end
|
|
|
|
local rt = {shutil.exec(inp)}
|
|
|
|
if rt[1] == true then
|
|
|
|
table.remove(rt,1)
|
2017-10-07 23:33:00 +11:00
|
|
|
end
|
2017-10-08 01:35:18 +11:00
|
|
|
print(table.unpack(rt))
|
|
|
|
end
|