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.
Showing the changes to TOOLS/lua/command-test.lua (1 of 5 files). Show all
Unified · Split
| @@ -50,4 +50,9 @@ mp.observe_property("vo-configured", "bool", function(_, v) · 49 unmodified lines | |||
| 50 | function(res, val, err) | 50 | function(res, val, err) |
| 51 | print("done err scr.: " .. join(" ", {res, val, err})) | 51 | print("done err scr.: " .. join(" ", {res, val, err})) |
| 52 | end) | 52 | end) |
| 53 | |||
| 54 | mp.command_native_async({name = "subprocess", args = {"sh", "-c", "echo hi && sleep 10s"}, capture_stdout = true}, | ||
| 55 | function(res, val, err) | ||
| 56 | print("done subprocess: " .. join(" ", {res, val, err})) | ||
| 57 | end) | ||
| 53 | end) | 58 | end) |