summaryrefslogtreecommitdiff
path: root/utils/hwstub/tools/lua
diff options
context:
space:
mode:
authorMarcin Bukat <marcin.bukat@gmail.com>2015-06-28 17:51:43 +0200
committerMarcin Bukat <marcin.bukat@gmail.com>2015-06-28 17:55:17 +0200
commite70ea5d21ff1aca5b8c534da8f3a1ccadd330a2e (patch)
tree611750d6bd70f20585801cfd7e8c441180798bee /utils/hwstub/tools/lua
parent465eb727a30fd1f4470ff6c172f7b41856775167 (diff)
downloadrockbox-e70ea5d21ff1aca5b8c534da8f3a1ccadd330a2e.tar.gz
rockbox-e70ea5d21ff1aca5b8c534da8f3a1ccadd330a2e.zip
hwstub: Add completion and some pretty printing to the shell
This uses slightly hacked luaprompt to provide all the goodis. See https://github.com/dpapavas/luaprompt for original. Change-Id: Iedddb79abae5809299322bc215722dd928c35cca
Diffstat (limited to 'utils/hwstub/tools/lua')
-rw-r--r--utils/hwstub/tools/lua/hwlib.lua6
1 files changed, 4 insertions, 2 deletions
diff --git a/utils/hwstub/tools/lua/hwlib.lua b/utils/hwstub/tools/lua/hwlib.lua
index 5bbd1e2668..02ab9718d4 100644
--- a/utils/hwstub/tools/lua/hwlib.lua
+++ b/utils/hwstub/tools/lua/hwlib.lua
@@ -22,6 +22,8 @@ function HWLIB.load_blob(filename, address)
22 io.close(f) 22 io.close(f)
23end 23end
24 24
25function HWLIB.printf(s,...) 25function HWLIB.printf(...)
26 return io.write(s:format(...)) 26 local function wrapper(...) io.write(string.format(...)) end
27 local status, result = pcall(wrapper, ...)
28 if not status then error(result, 2) end
27end 29end