summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOpportunityLiu <[email protected]>2019-06-05 22:01:23 +0800
committerOpportunityLiu <[email protected]>2019-06-05 22:01:23 +0800
commit34cf94bc1650a6e909e9fa3ee88d5cc3cb46eec2 (patch)
treec510bcddd80285e3f8c3d5e53f6148b4c4b1ea29
parent9904758b699e35ef5fc0b52b21651e90791b94d2 (diff)
rename to names
-rw-r--r--xmake/core/sandbox/modules/import/core/base/task.lua8
-rw-r--r--xmake/modules/private/utils/complete.lua12
2 files changed, 5 insertions, 15 deletions
diff --git a/xmake/core/sandbox/modules/import/core/base/task.lua b/xmake/core/sandbox/modules/import/core/base/task.lua
index 98f22b0e2..030780102 100644
--- a/xmake/core/sandbox/modules/import/core/base/task.lua
+++ b/xmake/core/sandbox/modules/import/core/base/task.lua
@@ -70,12 +70,12 @@ function sandbox_core_base_task.run(taskname, options, ...)
end
-function sandbox_core_base_task.tasks()
- local tasks = {}
+function sandbox_core_base_task.names()
+ local names = {}
for k, _ in pairs(task.tasks()) do
- table.insert(tasks, k)
+ table.insert(names, k)
end
- return tasks
+ return names
end
-- return module
diff --git a/xmake/modules/private/utils/complete.lua b/xmake/modules/private/utils/complete.lua
index 92ea93e9a..1e51f8d8f 100644
--- a/xmake/modules/private/utils/complete.lua
+++ b/xmake/modules/private/utils/complete.lua
@@ -101,7 +101,7 @@ function main(position, ...)
local tasks = {}
local shortnames = {}
- for _, v in ipairs(task.tasks()) do
+ for _, v in ipairs(task.names()) do
local menu = option.taskmenu(v)
tasks[v] = menu
if menu.shortname then
@@ -117,16 +117,6 @@ function main(position, ...)
local segs = word:split("%s")
local task_name = table.remove(segs, 1) or ""
- 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 #segs == 0 and not has_space then
if _complete_task(tasks, task_name) then return end
end