made luash nicer to use

This commit is contained in:
Izaya 2017-08-01 16:38:43 +10:00
parent 72e71c4c23
commit 3d932ac480
1 changed files with 5 additions and 1 deletions

View File

@ -5,7 +5,11 @@ spawn("lua shell",function()
print(_VERSION)
while true do
write((os.getenv("PWD") or "").."> ")
print(pcall(load(readln())))
local inp=readln()
if inp:sub(1,1) == "=" then inp="return "..inp:sub(2) end
local r={pcall(load(inp))}
if r[1] == true then table.remove(r,1) end
print(table.unpack(r))
end
end,si)
end