diff options
Diffstat (limited to 'xmake/plugins')
| -rwxr-xr-x | xmake/plugins/doxygen/xmake.lua | 2 | ||||
| -rwxr-xr-x | xmake/plugins/lua/xmake.lua | 15 | ||||
| -rwxr-xr-x | xmake/plugins/macro/main.lua | 2 | ||||
| -rwxr-xr-x | xmake/plugins/macro/xmake.lua | 50 | ||||
| -rwxr-xr-x | xmake/plugins/project/main.lua | 1 |
5 files changed, 40 insertions, 30 deletions
diff --git a/xmake/plugins/doxygen/xmake.lua b/xmake/plugins/doxygen/xmake.lua index 081ed7034..4bead9547 100755 --- a/xmake/plugins/doxygen/xmake.lua +++ b/xmake/plugins/doxygen/xmake.lua @@ -32,7 +32,7 @@ task("doxygen") usage = "xmake doxygen [options] [name] [arguments]" -- description - , description = "Generate the doxygen document for the given name" + , description = "Generate the doxygen document for the given name." -- options , options = diff --git a/xmake/plugins/lua/xmake.lua b/xmake/plugins/lua/xmake.lua index 5473a3b55..519a06d1d 100755 --- a/xmake/plugins/lua/xmake.lua +++ b/xmake/plugins/lua/xmake.lua @@ -32,6 +32,16 @@ task("lua") -- imports import("core.base.option") + -- list all scripts? + print("scripts:") + if option.get("list") then + local files = os.match(path.join(os.scriptdir(), "scripts/*.lua")) + for _, file in ipairs(files) do + print(" " .. path.basename(file)) + end + return + end + -- get script name local name = option.get("script") if not name then @@ -57,8 +67,9 @@ task("lua") -- options , options = { - {nil, "script", "v", nil, "Run the given lua script." } - , {nil, "arguments", "vs", nil, "The script arguments" } + {'l', "list", "k", nil, "List all scripts." } + , {nil, "script", "v", nil, "Run the given lua script." } + , {nil, "arguments", "vs", nil, "The script arguments." } } }) 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." } } }) diff --git a/xmake/plugins/project/main.lua b/xmake/plugins/project/main.lua index 7d5362c9f..fc8b63ec8 100755 --- a/xmake/plugins/project/main.lua +++ b/xmake/plugins/project/main.lua @@ -71,5 +71,4 @@ function main() -- trace print("create ok!") - end |
