summaryrefslogtreecommitdiff
path: root/xmake
diff options
context:
space:
mode:
authorruki <[email protected]>2026-06-06 14:51:02 +0800
committerGitHub <[email protected]>2026-06-06 14:51:02 +0800
commit7321e2c79352c7c03d304b2f81775e8b4e94d212 (patch)
tree18971b50facd07948e673bc4bc0fb9ab5c76a9aa /xmake
parent2245e0b6ed0f954aae1dafe225c2b436ae98cfcd (diff)
parent88c1ce87032df1c1f215cadaf6fff8a7958b06b8 (diff)
Merge pull request #7587 from Meha555/fix/enable-show-format-json
Enable `xmake show --format=json`
Diffstat (limited to 'xmake')
-rw-r--r--xmake/plugins/show/showlist.lua8
1 files changed, 6 insertions, 2 deletions
diff --git a/xmake/plugins/show/showlist.lua b/xmake/plugins/show/showlist.lua
index 205ae21ed..6adda6bd0 100644
--- a/xmake/plugins/show/showlist.lua
+++ b/xmake/plugins/show/showlist.lua
@@ -49,9 +49,11 @@ function _show_json(values)
end
function main(values)
- if option.get("json") then
+ local format = option.get("format")
+ -- List providers only support plain text and JSON output.
+ if option.get("json") or format == "json" then
_show_json(values)
- else
+ elseif format == nil or format == "plain" then
if table.is_dictionary(values) then
for k, v in pairs(values) do
cprint("${bright}%s:", k)
@@ -60,5 +62,7 @@ function main(values)
else
_show_text(values)
end
+ else
+ raise("unsupported list output format: %s", format)
end
end