diff options
| author | OpportunityLiu <[email protected]> | 2019-06-05 21:58:29 +0800 |
|---|---|---|
| committer | OpportunityLiu <[email protected]> | 2019-06-05 21:58:29 +0800 |
| commit | 9904758b699e35ef5fc0b52b21651e90791b94d2 (patch) | |
| tree | 5d857d48fef6e1938070d438e4541a97a8e3e35c | |
| parent | 9d9b13d8e95455d3e3cb1046be764355a5b0f4a5 (diff) | |
fix
| -rw-r--r-- | xmake/modules/private/utils/complete.lua | 14 |
1 files changed, 13 insertions, 1 deletions
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") |
