summaryrefslogtreecommitdiff
path: root/xmake/plugins/show/main.lua
diff options
context:
space:
mode:
authorruki <[email protected]>2026-04-20 17:35:48 +0800
committerGitHub <[email protected]>2026-04-20 17:35:48 +0800
commit55f8d448564f7cc198edb4db506ec7c18ca8f0f6 (patch)
tree6822b239d43091d20037a99b6ffa9fd7e449f1db /xmake/plugins/show/main.lua
parent3a1b4e1719ba50b259afa27b450f06c39548003d (diff)
parent4e3f6b16db88b9c1afad898a7f5dfeaecdfd0f27 (diff)
Merge pull request #7490 from xmake-io/show
Export target dependency graph as json/dot
Diffstat (limited to 'xmake/plugins/show/main.lua')
-rw-r--r--xmake/plugins/show/main.lua22
1 files changed, 14 insertions, 8 deletions
diff --git a/xmake/plugins/show/main.lua b/xmake/plugins/show/main.lua
index 9dc4f519a..7e04b7a43 100644
--- a/xmake/plugins/show/main.lua
+++ b/xmake/plugins/show/main.lua
@@ -32,14 +32,20 @@ function main()
local listname = option.get("list")
if listname then
return _show_list(listname)
- else
- -- show the information of the given object
- for _, filepath in ipairs(os.files(path.join(os.scriptdir(), "info", "*.lua"))) do
- local name = path.basename(filepath)
- if option.get(name) then
- local show_info = assert(import("info." .. name, {try = true, anonymous = true}), "unknown option name(%s)", name)
- return show_info(option.get(name))
- end
+ end
+
+ local infoname = option.get("info")
+ if infoname then
+ local show_info = assert(import("info." .. infoname, {try = true, anonymous = true}), "unknown info name(%s)", infoname)
+ return show_info(option.get("target"))
+ end
+
+ -- fallback to legacy options format
+ for _, filepath in ipairs(os.files(path.join(os.scriptdir(), "info", "*.lua"))) do
+ local name = path.basename(filepath)
+ if option.get(name) then
+ local show_info = assert(import("info." .. name, {try = true, anonymous = true}), "unknown option name(%s)", name)
+ return show_info(option.get(name))
end
end