summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2022-05-29 16:31:15 +0800
committerruki <[email protected]>2022-05-29 16:31:15 +0800
commit7e86c052217b255c95e3cd780bdee4153dd3c9bd (patch)
treeffa10923c8a87fa9ae0afe04885f940037f6f5ad
parentd534e9346890b433de548294204b214e81319c78 (diff)
add run --detach
-rw-r--r--xmake/actions/run/main.lua2
-rw-r--r--xmake/actions/run/xmake.lua1
2 files changed, 2 insertions, 1 deletions
diff --git a/xmake/actions/run/main.lua b/xmake/actions/run/main.lua
index 0b738aab6..50711ffbc 100644
--- a/xmake/actions/run/main.lua
+++ b/xmake/actions/run/main.lua
@@ -60,7 +60,7 @@ function _do_run_target(target)
if option.get("debug") then
debugger.run(targetfile, option.get("arguments"))
else
- os.execv(targetfile, option.get("arguments"))
+ os.execv(targetfile, option.get("arguments"), {detach = option.get("detach")})
end
-- restore the previous directory
diff --git a/xmake/actions/run/xmake.lua b/xmake/actions/run/xmake.lua
index dce6724a1..8a9f21449 100644
--- a/xmake/actions/run/xmake.lua
+++ b/xmake/actions/run/xmake.lua
@@ -53,6 +53,7 @@ task("run")
" xmake run -w .",
" xmake run --workdir=`pwd`" }
, {'j', "jobs", "kv", "1", "Set the number of parallel compilation jobs." }
+ , {nil, "detach", "k", nil, "Run targets in detached processes." }
, {}
, {nil, "target", "v", nil , "The target name. It will run all default targets if this parameter is not specified."
, values = function (complete, opt)