From d9bc97bda6e4750af2fbbfcb51ddb6b2c04c277b Mon Sep 17 00:00:00 2001 From: wm4 Date: Sat, 12 May 2018 15:14:07 +0200 Subject: command: add a subprocess command This supports named arguments. It benefits from the infrastructure of async commands. The plan is to reimplement Lua's utils.subprocess() on top of it. --- TOOLS/lua/command-test.lua | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'TOOLS/lua') diff --git a/TOOLS/lua/command-test.lua b/TOOLS/lua/command-test.lua index 5fb8c7b0d7..94a91c2f57 100644 --- a/TOOLS/lua/command-test.lua +++ b/TOOLS/lua/command-test.lua @@ -50,4 +50,9 @@ mp.observe_property("vo-configured", "bool", function(_, v) function(res, val, err) print("done err scr.: " .. join(" ", {res, val, err})) end) + + mp.command_native_async({name = "subprocess", args = {"sh", "-c", "echo hi && sleep 10s"}, capture_stdout = true}, + function(res, val, err) + print("done subprocess: " .. join(" ", {res, val, err})) + end) end) -- cgit v1.2.3