summaryrefslogtreecommitdiff
path: root/xmake/core/base/option.lua
diff options
context:
space:
mode:
authorruki <[email protected]>2016-05-31 15:49:37 +0800
committerruki <[email protected]>2016-05-31 15:49:37 +0800
commit5769dba5932aad3a97c8db36c80a15064b71f556 (patch)
treecd08ffc12af5dc735fd1714adcaa2657e4b0f730 /xmake/core/base/option.lua
parent2258b6be79c6b07a197ca27f79c89baaf8fd3779 (diff)
add history
Diffstat (limited to 'xmake/core/base/option.lua')
-rw-r--r--xmake/core/base/option.lua22
1 files changed, 20 insertions, 2 deletions
diff --git a/xmake/core/base/option.lua b/xmake/core/base/option.lua
index 5e1ee1adf..eb9af790e 100644
--- a/xmake/core/base/option.lua
+++ b/xmake/core/base/option.lua
@@ -119,11 +119,28 @@ function option.restore()
end
end
+-- the command line
+function option.cmdline()
+
+ -- make command
+ local line = "xmake"
+ local argv = xmake._ARGV
+ for _, arg in ipairs(argv) do
+ if arg:find("%s") then
+ arg = "\"" .. arg .. "\""
+ end
+ line = line .. " " .. arg
+ end
+
+ -- ok?
+ return line
+end
+
-- init the option
-function option.init(argv, menu)
+function option.init(menu)
-- check
- assert(argv and menu)
+ assert(menu)
-- translate menu
option._translate(menu)
@@ -137,6 +154,7 @@ function option.init(argv, menu)
assert(context)
-- parse _ARGV
+ local argv = xmake._ARGV
local _iter, _s, _k = ipairs(argv)
while true do