From 9904758b699e35ef5fc0b52b21651e90791b94d2 Mon Sep 17 00:00:00 2001 From: OpportunityLiu Date: Wed, 5 Jun 2019 21:58:29 +0800 Subject: fix --- xmake/modules/private/utils/complete.lua | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/xmake/modules/private/utils/complete.lua b/xmake/modules/private/utils/complete.lua index 1f2521c63..92ea93e9a 100644 --- a/xmake/modules/private/utils/complete.lua +++ b/xmake/modules/private/utils/complete.lua @@ -98,8 +98,20 @@ function main(position, ...) if word:lower():startswith("xmake ") then word = word:sub(#"xmake " + 1) end + + local tasks = {} + local shortnames = {} + for _, v in ipairs(task.tasks()) do + local menu = option.taskmenu(v) + tasks[v] = menu + if menu.shortname then + shortnames[menu.shortname] = v + end + end + if word:lower() == "xmake" then - return _complete_task("") + _complete_task(tasks, "") + return end local segs = word:split("%s") -- cgit v1.3.1