summaryrefslogtreecommitdiff
path: root/xmake/plugins/show/showlist.lua
diff options
context:
space:
mode:
Diffstat (limited to 'xmake/plugins/show/showlist.lua')
-rw-r--r--xmake/plugins/show/showlist.lua11
1 files changed, 9 insertions, 2 deletions
diff --git a/xmake/plugins/show/showlist.lua b/xmake/plugins/show/showlist.lua
index 4e9c29c1e..a80fd3b01 100644
--- a/xmake/plugins/show/showlist.lua
+++ b/xmake/plugins/show/showlist.lua
@@ -40,13 +40,20 @@ function _show_text(values)
end
function _show_json(values)
- print(json.encode(json.mark_as_array(values)))
+ print(json.encode(values))
end
function main(values)
if option.get("json") then
_show_json(values)
else
- _show_text(values)
+ if table.is_dictionary(values) then
+ for k, v in pairs(values) do
+ cprint("${bright}%s:", k)
+ _show_text(v)
+ end
+ else
+ _show_text(values)
+ end
end
end