summaryrefslogtreecommitdiff
path: root/xmake/plugins/macro
diff options
context:
space:
mode:
authorruki <[email protected]>2016-06-01 08:16:54 +0800
committerruki <[email protected]>2016-06-01 08:16:54 +0800
commite720bbe224eb7aec57ca488a67e840a685fe612f (patch)
tree2735ac6524ec7ca93f7508eadfdfc3241ee08f0c /xmake/plugins/macro
parent5b2e0333389158094a2a8bb796e13f99fac422e7 (diff)
list lua scripts and fix arguments
Diffstat (limited to 'xmake/plugins/macro')
-rwxr-xr-xxmake/plugins/macro/main.lua2
-rwxr-xr-xxmake/plugins/macro/xmake.lua50
2 files changed, 26 insertions, 26 deletions
diff --git a/xmake/plugins/macro/main.lua b/xmake/plugins/macro/main.lua
index 89c6e1f54..3de5ca598 100755
--- a/xmake/plugins/macro/main.lua
+++ b/xmake/plugins/macro/main.lua
@@ -201,7 +201,7 @@ function _run(macroname)
macro = import(macroname, {rootdir = _directory()})
-- run macro
- macro.main((option.get("argv") or ""):split("%s"))
+ macro.main(option.get("arguments"))
-- trace
print("run macro(%s) ok!", macroname)
diff --git a/xmake/plugins/macro/xmake.lua b/xmake/plugins/macro/xmake.lua
index dc4f9ca1a..f28c5b49f 100755
--- a/xmake/plugins/macro/xmake.lua
+++ b/xmake/plugins/macro/xmake.lua
@@ -35,7 +35,7 @@ task("macro")
usage = "xmake macro|m [options] [name] [arguments]"
-- description
- , description = "Run the given macro"
+ , description = "Run the given macro."
-- xmake m
, shortname = 'm'
@@ -43,32 +43,32 @@ task("macro")
-- options
, options =
{
- {'b', "begin", "k", nil, "Start to record macro."
- , ".e.g"
- , "Record macro with name: test"
- , " xmake macro --begin"
- , " xmake config --plat=macosx"
- , " xmake clean"
- , " xmake -r"
- , " xmake package"
- , " xmake macro --end test" }
- , {'e', "end", "k", nil, "Stop to record macro." }
+ {'b', "begin", "k", nil, "Start to record macro."
+ , ".e.g"
+ , "Record macro with name: test"
+ , " xmake macro --begin"
+ , " xmake config --plat=macosx"
+ , " xmake clean"
+ , " xmake -r"
+ , " xmake package"
+ , " xmake macro --end test" }
+ , {'e', "end", "k", nil, "Stop to record macro." }
, {}
- , {nil, "show", "k", nil, "Show the content of the given macro." }
- , {'l', "list", "k", nil, "List all macros." }
- , {'d', "delete", "k", nil, "Delete the given macro." }
+ , {nil, "show", "k", nil, "Show the content of the given macro." }
+ , {'l', "list", "k", nil, "List all macros." }
+ , {'d', "delete", "k", nil, "Delete the given macro." }
, {}
- , {nil, "import", "kv", nil, "Import the given macro file."
- , ".e.g"
- , " xmake macro --import=/xxx/macro.lua test" }
- , {nil, "export", "kv", nil, "Export the given macro to file."
- , ".e.g"
- , " xmake macro --export=/xxx/macro.lua test" }
+ , {nil, "import", "kv", nil, "Import the given macro file."
+ , ".e.g"
+ , " xmake macro --import=/xxx/macro.lua test" }
+ , {nil, "export", "kv", nil, "Export the given macro to file."
+ , ".e.g"
+ , " xmake macro --export=/xxx/macro.lua test" }
, {}
- , {'a', "argv", "kv", nil, "Set the macro arguments." }
- , {nil, "name", "v", ".", "The given macro name."
- , ".e.g"
- , " Run the given macro: xmake macro test"
- , " Run the anonymous macro: xmake macro ." }
+ , {nil, "name", "v", ".", "Set the macro name."
+ , ".e.g"
+ , " Run the given macro: xmake macro test"
+ , " Run the anonymous macro: xmake macro ." }
+ , {nil, "arguments", "vs", nil, "Set the macro arguments." }
}
})