text
[RRG-proxmark3.git] / client / luascripts / examples / example_cmdline.lua
blobe2f89f77c11487600593bc404f3edc4e8b635523
1 #!/usr/bin/env -S pm3 -l
3 --[[
4 A sampe script file on how to implement at cmd line interface.
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");