maur keys
[RRG-proxmark3.git] / client / luascripts / examples / example_cmdline.lua
blobbaa76eed6eaedd2df634ae84982b11b351b307ae
1 #!/usr/bin/env -S pm3 -l
3 --[[
4 A sampe script file on how to implement at cmd line inteface.
5 It also demonstrates how the script can be used with a shebang.
6 --]]
8 print("This is how a cmd-line interface could be implemented\nPrint 'exit' to exit.\n")
9 local answer
10 repeat
11 io.write("$>")
12 io.flush()
13 answer = io.read()
14 if answer ~= 'exit' then
15 local func = assert(loadstring("return " .. answer))
16 io.write("\n"..tostring(func() or "").."\n");
17 end--]]
18 until answer == "exit"
19 print("Bye\n");