summaryrefslogtreecommitdiff
path: root/xmake/plugins/macro/xmake.lua
diff options
context:
space:
mode:
authorOpportunity <[email protected]>2020-01-20 20:30:31 +0800
committerOpportunity <[email protected]>2020-01-20 22:21:47 +0800
commit3364333877dc8a579f08b54099fda653948e07ab (patch)
tree2c2d5b6dabd5937827f9ae0cbc511b8a2f16f5d4 /xmake/plugins/macro/xmake.lua
parent5f96933d1ad672cc5b29df88a78b32ff4cdd3ebc (diff)
improve tab complete
Diffstat (limited to 'xmake/plugins/macro/xmake.lua')
-rw-r--r--xmake/plugins/macro/xmake.lua20
1 files changed, 15 insertions, 5 deletions
diff --git a/xmake/plugins/macro/xmake.lua b/xmake/plugins/macro/xmake.lua
index 24157dfe0..e414ba246 100644
--- a/xmake/plugins/macro/xmake.lua
+++ b/xmake/plugins/macro/xmake.lua
@@ -41,10 +41,10 @@ task("macro")
-- options
, options =
{
- {'b', "begin", "k", nil, "Start to record macro."
+ {'b', "begin", "k", nil, "Start to record macro."
, "e.g."
, "Record macro with name: test"
- , " xmake macro --begin"
+ , " xmake macro --begin"
, " xmake config --plat=macosx"
, " xmake clean"
, " xmake -r"
@@ -68,9 +68,19 @@ task("macro")
, {}
, {nil, "name", "v", ".", "Set the macro name."
, "e.g."
- , " Run the given macro: xmake macro test"
- , " Run the anonymous macro: xmake macro ."
- , " Run the last command: xmake macro .." }
+ , " Run the given macro: xmake macro test"
+ , " Run the anonymous macro: xmake macro ."
+ , " Run the last command: xmake macro .."
+ , values = function (complete, opt)
+ -- hide in help menu
+ if not complete then return end
+ -- don't need name
+ if opt.begin or opt.list or opt.clear then return end
+ -- name should be given by user
+ if opt["end"] or opt.import then return end
+
+ return import("main.macros")(".")
+ end }
, {nil, "arguments", "vs", nil, "Set the macro arguments." }
}
}