summaryrefslogtreecommitdiff
path: root/xmake/modules/private/utils/complete.lua
diff options
context:
space:
mode:
authorGly <[email protected]>2022-12-22 00:02:01 +0100
committerGly <[email protected]>2022-12-22 00:02:01 +0100
commitc3ca3ff48a2dfb9dd15af62102af539dec58c385 (patch)
treeeb8916d7ede63e5f7f9a519fe7e7e50fdf1aff87 /xmake/modules/private/utils/complete.lua
parentdac2aa7b79c89c5590c86b3552c5ac4b1227500e (diff)
rewrite complete tasks
Diffstat (limited to 'xmake/modules/private/utils/complete.lua')
-rw-r--r--xmake/modules/private/utils/complete.lua10
1 files changed, 5 insertions, 5 deletions
diff --git a/xmake/modules/private/utils/complete.lua b/xmake/modules/private/utils/complete.lua
index bcc961d94..09f0b8ca6 100644
--- a/xmake/modules/private/utils/complete.lua
+++ b/xmake/modules/private/utils/complete.lua
@@ -87,12 +87,12 @@ function _find_candidates(candidates, find)
end
function _complete_task(tasks, name)
- local has_candidate = false
- for _, v in ipairs(_find_candidates((table.keys(tasks)), name)) do
- _print_candidate(true, "%s", v)
- has_candidate = true
+ local found_candidates = {}
+ for i, v in ipairs(_find_candidates((table.keys(tasks)), name)) do
+ table.insert(found_candidates, { value = v, description = tasks[v].description })
end
- return has_candidate
+ _print_candidates(has_candidate, found_candidates)
+ return #found_candidates > 0
end
-- complete values of kv