summaryrefslogtreecommitdiff
path: root/xmake/plugins/show/main.lua
diff options
context:
space:
mode:
authorruki <[email protected]>2020-06-02 00:53:26 +0800
committerruki <[email protected]>2020-06-01 23:20:38 +0800
commit1c11bcdcccf8cf183d9840b56bd003890f0df66b (patch)
tree8f2d49a1cca3a737bf5568afd94537d1c1b35552 /xmake/plugins/show/main.lua
parentc9c6aec399bbf0e069f2e5ca2c6596bfb0b80e83 (diff)
show target
Diffstat (limited to 'xmake/plugins/show/main.lua')
-rw-r--r--xmake/plugins/show/main.lua13
1 files changed, 11 insertions, 2 deletions
diff --git a/xmake/plugins/show/main.lua b/xmake/plugins/show/main.lua
index 816ca30a3..08f169a21 100644
--- a/xmake/plugins/show/main.lua
+++ b/xmake/plugins/show/main.lua
@@ -23,7 +23,7 @@ import("core.base.option")
-- show list
function _show_list(name)
- return assert(import("lists." .. name, {try = true, anonymous = true}), "unknown list name(%s)", name)()
+ assert(import("lists." .. name, {try = true, anonymous = true}), "unknown list name(%s)", name)()
end
-- main entry
@@ -32,6 +32,15 @@ function main()
-- show list?
local listname = option.get("list")
if listname then
- return _show_list(listname)
+ _show_list(listname)
+ else
+ 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 list name(%s)", name)
+ show_info(option.get(name))
+ break
+ end
+ end
end
end