From c3ca3ff48a2dfb9dd15af62102af539dec58c385 Mon Sep 17 00:00:00 2001 From: Gly Date: Thu, 22 Dec 2022 00:02:01 +0100 Subject: rewrite complete tasks --- xmake/modules/private/utils/complete.lua | 10 +++++----- 1 file 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 -- cgit v1.3.1