summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlonless9 <[email protected]>2025-06-06 01:30:03 +0800
committerlonless9 <[email protected]>2025-06-06 01:30:03 +0800
commitc57e967a612201bf4edee2bdecfd89e08a2afc19 (patch)
tree955665b49030d2edec63aa7d98ded0d3cac82693
parent5c39da6e7dce986e0e2c2d09d2f1ef2fd23ce435 (diff)
dec pattern
-rw-r--r--xmake/plugins/show/lists/targets.lua14
1 files changed, 6 insertions, 8 deletions
diff --git a/xmake/plugins/show/lists/targets.lua b/xmake/plugins/show/lists/targets.lua
index ce398fc77..57cf78b53 100644
--- a/xmake/plugins/show/lists/targets.lua
+++ b/xmake/plugins/show/lists/targets.lua
@@ -29,19 +29,17 @@ import(".showlist")
function main()
config.load()
- local group_pattern = option.get("group")
- if group_pattern then
- group_pattern = "^" .. path.pattern(group_pattern) .. "$"
- end
+ local group_pattern = option.get("group") and ("^" .. path.pattern(option.get("group")) .. "$")
local targets = {}
for name, target in pairs(project.targets()) do
local group = target:get("group")
if (target:is_default() and not group_pattern) or
- (group_pattern and group and (group:match(group_pattern) or
- table.find_first_if(group:split("[/\\]"), function(i, component)
- return component:match(group_pattern)
- end))) then
+ (group_pattern and group and (function()
+ for component in group:gmatch("[^/\\\\]+") do
+ if component:match(group_pattern) then return true end
+ end
+ end)()) then
table.insert(targets, name)
end
end