diff options
| author | ruki <[email protected]> | 2016-06-01 08:16:54 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2016-06-01 08:16:54 +0800 |
| commit | e720bbe224eb7aec57ca488a67e840a685fe612f (patch) | |
| tree | 2735ac6524ec7ca93f7508eadfdfc3241ee08f0c /xmake/plugins/lua/xmake.lua | |
| parent | 5b2e0333389158094a2a8bb796e13f99fac422e7 (diff) | |
list lua scripts and fix arguments
Diffstat (limited to 'xmake/plugins/lua/xmake.lua')
| -rwxr-xr-x | xmake/plugins/lua/xmake.lua | 15 |
1 files changed, 13 insertions, 2 deletions
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." } } }) |
