Added a PoC script which implements a commandline

This commit is contained in:
martin.holst@gmail.com 2013-05-24 21:06:20 +00:00
parent a0655c45bd
commit 1ef665776d

View file

@ -0,0 +1,12 @@
print("This is how a cmd-line interface could be implemented\nPrint 'exit' to exit.\n")
local answer
repeat
io.write("$>")
io.flush()
answer=io.read()
if answer ~= 'exit' then
local func = assert(loadstring("return " .. answer))
io.write("\n"..tostring(func() or "").."\n");
end--]]
until answer=="exit"
print("Bye\n");