diff options
| author | ruki <[email protected]> | 2024-04-23 23:20:07 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2024-04-23 23:20:07 +0800 |
| commit | 9f2d6865e1d85fbf5a4cf3f6bae1648be32cd5e3 (patch) | |
| tree | a7967c501b43a41dc504bed7e330c2f2bdf9728f /xmake/plugins/show/showlist.lua | |
| parent | ee9a482a5579e99f922a6df77f0336ce96e98373 (diff) | |
add scope and instance apis
Diffstat (limited to 'xmake/plugins/show/showlist.lua')
| -rw-r--r-- | xmake/plugins/show/showlist.lua | 11 |
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 |
