diff options
| -rw-r--r-- | xmake/plugins/show/lists/architectures.lua | 10 | ||||
| -rw-r--r-- | xmake/plugins/show/lists/packages.lua | 2 |
2 files changed, 10 insertions, 2 deletions
diff --git a/xmake/plugins/show/lists/architectures.lua b/xmake/plugins/show/lists/architectures.lua index 8eba152f2..0aecc6e1e 100644 --- a/xmake/plugins/show/lists/architectures.lua +++ b/xmake/plugins/show/lists/architectures.lua @@ -22,6 +22,8 @@ import("core.project.project") import("core.platform.platform") import("core.base.text") +import("core.base.option") +import(".showlist") -- show all platforms function main() @@ -35,6 +37,7 @@ function main() -- get all architectures local result = {align = 'l', sep = " "} + local json_result = {} for i, plat in ipairs(plats) do local archs = try {function () return project.allowed_archs(plat) end} if archs then @@ -45,7 +48,12 @@ function main() end if archs and #archs > 0 then table.insert(result, table.join(plat, archs)) + json_result[plat] = archs end end - print(text.table(result)) + if option.get("json") then + showlist(json_result) + else + print(text.table(result)) + end end diff --git a/xmake/plugins/show/lists/packages.lua b/xmake/plugins/show/lists/packages.lua index 8c8f45c20..3aeedc0d2 100644 --- a/xmake/plugins/show/lists/packages.lua +++ b/xmake/plugins/show/lists/packages.lua @@ -20,7 +20,7 @@ -- imports import("core.project.config") -import("require.list", {rootdir = path.join(os.programdir(), "actions"), alias = "show_packages"}) +import("private.action.require.list", { alias = "show_packages" }) import(".showlist") -- show all packages |
