History

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.

wm4 committed 8 years ago

Commit d9bc97b1 parent 1aae88b5 files · +108 −0Browse files

Showing the changes to TOOLS/lua/command-test.lua (1 of 5 files). Show all

Unified · Split

TOOLS/lua/command-test.lua+5−0
@@ -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)
53end)58end)

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t