diff options
author | wm4 <wm4@nowhere> | 2018-05-12 15:14:07 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2018-05-24 19:56:34 +0200 |
commit | d9bc97bda6e4750af2fbbfcb51ddb6b2c04c277b (patch) | |
tree | 28e21cbff4d4e102696c0416045973e7d851bdbf /TOOLS | |
parent | 1aae88b4879f40c68cebbdcd47895787ecdcdf68 (diff) | |
download | mpv-d9bc97bda6e4750af2fbbfcb51ddb6b2c04c277b.tar.bz2 mpv-d9bc97bda6e4750af2fbbfcb51ddb6b2c04c277b.tar.xz |
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.
Diffstat (limited to 'TOOLS')
-rw-r--r-- | TOOLS/lua/command-test.lua | 5 |
1 files changed, 5 insertions, 0 deletions
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) |