diff options
Diffstat (limited to 'xmake/plugins/show/info/basic.lua')
| -rw-r--r-- | xmake/plugins/show/info/basic.lua | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/xmake/plugins/show/info/basic.lua b/xmake/plugins/show/info/basic.lua index a08b47d3a..47b0f72e7 100644 --- a/xmake/plugins/show/info/basic.lua +++ b/xmake/plugins/show/info/basic.lua @@ -128,13 +128,20 @@ function main() config.load() - local opt = {json = option.get("json")} + local opt = { + json = option.get("json"), + pretty = option.get("pretty") + } local result = opt.json and {} or nil result = _show_xmake_info(opt, result) result = _show_project_info(opt, result) if opt.json then - print(json.encode(result or {})) + local json_opt + if opt.pretty then + json_opt = {pretty = true} + end + print(json.encode(result or {}, json_opt)) end end |
