summaryrefslogtreecommitdiff
path: root/xmake/core
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/core
parent5b2e0333389158094a2a8bb796e13f99fac422e7 (diff)
list lua scripts and fix arguments
Diffstat (limited to 'xmake/core')
-rw-r--r--xmake/core/base/option.lua4
-rw-r--r--xmake/core/sandbox/modules/os.lua16
2 files changed, 19 insertions, 1 deletions
diff --git a/xmake/core/base/option.lua b/xmake/core/base/option.lua
index eb9af790e..7deb2a3f4 100644
--- a/xmake/core/base/option.lua
+++ b/xmake/core/base/option.lua
@@ -724,13 +724,15 @@ function option.show_options(options)
if name then
if mode == "v" then
option_info = option_info .. " " .. name
+ elseif mode == "vs" then
+ option_info = option_info .. " " .. name .. " ..."
else
option_info = option_info .. option._ifelse(shortname, ", --", " --") .. name
end
if mode == "kv" then
option_info = option_info .. "=" .. name:upper()
end
- elseif mode == "v" then
+ elseif mode == "v" or mode == "vs" then
option_info = option_info .. " ..."
end
diff --git a/xmake/core/sandbox/modules/os.lua b/xmake/core/sandbox/modules/os.lua
index 923cc5852..9babc4318 100644
--- a/xmake/core/sandbox/modules/os.lua
+++ b/xmake/core/sandbox/modules/os.lua
@@ -24,6 +24,7 @@
local io = require("base/io")
local os = require("base/os")
local utils = require("base/utils")
+local sandbox = require("sandbox/sandbox")
local vformat = require("sandbox/modules/vformat")
-- define module
@@ -174,6 +175,21 @@ function sandbox_os.programdir()
return xmake._PROGRAM_DIR
end
+-- get the script directory
+function sandbox_os.scriptdir()
+
+ -- get the current sandbox instance
+ local instance = sandbox.instance()
+ assert(instance)
+
+ -- the root directory for this sandbox script
+ local rootdir = instance:rootdir()
+ assert(rootdir)
+
+ -- ok
+ return rootdir
+end
+
-- run shell
function sandbox_os.run(cmd, ...)