proxmark3/client/scripts/cmdline.lua

17 lines
433 B
Lua
Raw Normal View History

2019-05-08 04:48:18 +08:00
--[[
A sampe script file on how to implement at cmd line inteface.
--]]
print("This is how a cmd-line interface could be implemented\nPrint 'exit' to exit.\n")
local answer
repeat
2019-03-09 17:34:43 +08:00
io.write("$>")
io.flush()
2019-05-08 04:48:18 +08:00
answer = io.read()
2019-03-09 17:34:43 +08:00
if answer ~= 'exit' then
local func = assert(loadstring("return " .. answer))
io.write("\n"..tostring(func() or "").."\n");
end--]]
2019-05-08 04:48:18 +08:00
until answer == "exit"
print("Bye\n");