summaryrefslogtreecommitdiffstatshomepage
path: root/plugins/cheat/xml_to_json.lua
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/cheat/xml_to_json.lua')
-rw-r--r--plugins/cheat/xml_to_json.lua11
1 files changed, 11 insertions, 0 deletions
diff --git a/plugins/cheat/xml_to_json.lua b/plugins/cheat/xml_to_json.lua
new file mode 100644
index 00000000000..1273fb9885e
--- /dev/null
+++ b/plugins/cheat/xml_to_json.lua
@@ -0,0 +1,11 @@
+xml = require("cheat_xml")
+json = dofile("../json/init.lua")
+
+function readAll(file)
+ local f = io.open(file, "rb")
+ local content = f:read("*all")
+ f:close()
+ return content
+end
+
+print(json.stringify(xml.conv_cheat(readAll(arg[1])), {indent = true}))