blob: 050b89d5393e8233de7624430f6843f1c060e648 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
|
#!/usr/bin/env lua
-- usage: json2lua.lua [json_file]
--
-- Eg:
-- echo '[ "testing" ]' | ./json2lua.lua
-- ./json2lua.lua test.json
local json = require "cjson"
local misc = require "cjson-misc"
local json_text = misc.file_load(arg[1])
local t = json.decode(json_text)
print(misc.serialise_value(t))
|