diff options
| author | ruki <[email protected]> | 2026-03-03 00:35:32 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2026-03-03 00:35:32 +0800 |
| commit | adc44b2e92c94ff795071ac8ed0d08a0a29f36cf (patch) | |
| tree | 858e340fb0346cb7a62836ce3137c7ff05f1793f | |
| parent | b01dcb775c98cc48abe65a91ef9bf093be875682 (diff) | |
improve create help menutemplate
| -rw-r--r-- | xmake/actions/create/xmake.lua | 9 |
1 files 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}, |
