RRG-Proxmark3/client/luascripts/examples/example_cmdline.lua
Philippe Teuwen 88308ea727 typos
2021-10-10 01:35:45 +02:00

20 lines
524 B
Lua
Executable File

#!/usr/bin/env -S pm3 -l
--[[
A sampe script file on how to implement at cmd line interface.
It also demonstrates how the script can be used with a shebang.
--]]
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");