From adc44b2e92c94ff795071ac8ed0d08a0a29f36cf Mon Sep 17 00:00:00 2001 From: ruki Date: Tue, 3 Mar 2026 00:35:32 +0800 Subject: improve create help menu --- xmake/actions/create/xmake.lua | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/xmake/actions/create/xmake.lua b/xmake/actions/create/xmake.lua index 3d14a856a..a59c56296 100644 --- a/xmake/actions/create/xmake.lua +++ b/xmake/actions/create/xmake.lua @@ -56,11 +56,16 @@ task("create") values = function (complete, opt) if complete then import("actions.create.template", {rootdir = os.programdir()}) - local templates = {} + import("core.base.hashset") + local templates_set = hashset.new() local languages = opt.language and {opt.language} or template.languages() for _, l in ipairs(languages) do - table.join2(templates, template.templates(l)) + for _, t in ipairs(template.templates(l)) do + templates_set:insert(t) + end end + local templates = templates_set:to_array() + table.sort(templates) return templates end end}, -- cgit v1.3.1