rewrite client demo by lua, remove old C version client demo

This commit is contained in:
Cloud Wu
2014-04-14 17:00:42 +08:00
parent 1e9a27232b
commit 904b68b5a5
45 changed files with 11717 additions and 12 deletions

20
3rd/lua-cjson/lua/lua2json.lua Executable file
View File

@@ -0,0 +1,20 @@
#!/usr/bin/env lua
-- usage: lua2json.lua [lua_file]
--
-- Eg:
-- echo '{ "testing" }' | ./lua2json.lua
-- ./lua2json.lua test.lua
local json = require "cjson"
local util = require "cjson.util"
local env = {
json = { null = json.null },
null = json.null
}
local t = util.run_script("data = " .. util.file_load(arg[1]), env)
print(json.encode(t.data))
-- vi:ai et sw=4 ts=4: