diff options
| author | Opportunity <[email protected]> | 2020-01-20 20:30:31 +0800 |
|---|---|---|
| committer | Opportunity <[email protected]> | 2020-01-20 22:21:47 +0800 |
| commit | 3364333877dc8a579f08b54099fda653948e07ab (patch) | |
| tree | 2c2d5b6dabd5937827f9ae0cbc511b8a2f16f5d4 /xmake/plugins/project/xmake.lua | |
| parent | 5f96933d1ad672cc5b29df88a78b32ff4cdd3ebc (diff) | |
improve tab complete
Diffstat (limited to 'xmake/plugins/project/xmake.lua')
| -rw-r--r-- | xmake/plugins/project/xmake.lua | 39 |
1 files changed, 23 insertions, 16 deletions
diff --git a/xmake/plugins/project/xmake.lua b/xmake/plugins/project/xmake.lua index 31be1e90b..f5c6c6b30 100644 --- a/xmake/plugins/project/xmake.lua +++ b/xmake/plugins/project/xmake.lua @@ -38,22 +38,29 @@ task("project") -- options , options = { - {'k', "kind", "kv", "makefile", "Set the project kind." - , " - makefile" - , " - xmakefile (makefile with xmake)" - , " - cmakelists" - , " - compile_flags" - , " - compile_commands (clang compilation database with json format)" - , " - vs (auto detect), vs2002, vs2003, vs2005, vs2008" - , " - vs2010, vs2012, vs2013, vs2015, vs2017, vs2019" - , " - vsxmake (auto detect), vsxmake2010 ~ vsxmake2019" } - , {'m', "modes", "kv", nil, "Set the project modes." - , " e.g. " - , " - xmake project -k vsxmake -m \"release" .. path.envsep() .. "debug\"" } - , {'a', "archs", "kv", nil, "Set the project archs." - , " e.g. " - , " - xmake project -k vsxmake -a \"x86" .. path.envsep() .. "x64\"" } - , {nil, "outputdir", "v", ".", "Set the output directory." } + {'k', "kind", "kv" , "makefile", "Set the project kind." + , " - makefile" + , " - xmakefile (makefile with xmake)" + , " - cmakelists" + , " - compile_flags" + , " - compile_commands (clang compilation database with json format)" + , " - vs (auto detect), vs2002, vs2003, vs2005, vs2008" + , " - vs2010, vs2012, vs2013, vs2015, vs2017, vs2019" + , " - vsxmake (auto detect), vsxmake2010 ~ vsxmake2019" + , values = function (complete, opt) + if not complete then return end + + local values = table.keys(import("main.makers")()) + table.sort(values, function (a, b) return a > b end) + return values + end } + , {'m', "modes", "kv" , nil , "Set the project modes." + , " e.g. " + , " - xmake project -k vsxmake -m \"release" .. path.envsep() .. "debug\"" } + , {'a', "archs", "kv" , nil , "Set the project archs." + , " e.g. " + , " - xmake project -k vsxmake -a \"x86" .. path.envsep() .. "x64\"" } + , {nil, "outputdir", "v" , "." , "Set the output directory." } } } |
