Fixes unused variable warnings.
Showing the changes to TOOLS/lua/command-test.lua (1 of 1 file). Show all
Unified · Split
| @@ -35,11 +35,11 @@ mp.observe_property("vo-configured", "bool", function(_, v) · 34 unmodified lines | ||
| 35 | 35 | timer:resume() |
| 36 | 36 | |
| 37 | 37 | print("Slow screenshot command...") |
| 38 | − res, err = mp.command_native({"screenshot"}) | |
| 38 | + res = mp.command_native({"screenshot"}) | |
| 39 | 39 | print("done, res: " .. utils.to_string(res)) |
| 40 | 40 | |
| 41 | 41 | print("Slow screenshot async command...") |
| 42 | − res, err = mp.command_native_async({"screenshot"}, function(res) | |
| 42 | + res = mp.command_native_async({"screenshot"}, function(res) | |
| 43 | 43 | print("done (async), res: " .. utils.to_string(res)) |
| 44 | 44 | timer:kill() |
| 45 | 45 | end) |
| @@ -78,13 +78,13 @@ mp.observe_property("vo-configured", "bool", function(_, v) · 32 unmodified lines | ||
| 78 | 78 | |
| 79 | 79 | mp.command_native_async({name = "subprocess", args = {"wc", "-c"}, |
| 80 | 80 | stdin_data = "hello", capture_stdout = true}, |
| 81 | − function(res, val, err) | |
| 81 | + function(_, val) | |
| 82 | 82 | print("Should be '5': " .. val.stdout) |
| 83 | 83 | end) |
| 84 | 84 | -- blocking stdin by default |
| 85 | 85 | mp.command_native_async({name = "subprocess", args = {"cat"}, |
| 86 | 86 | capture_stdout = true}, |
| 87 | − function(res, val, err) | |
| 87 | + function(_, val) | |
| 88 | 88 | print("Should be 0: " .. #val.stdout) |
| 89 | 89 | end) |
| 90 | 90 | -- stdin + detached |
| @@ -92,7 +92,7 @@ mp.observe_property("vo-configured", "bool", function(_, v) · 1 unmodified line | ||
| 92 | 92 | args = {"bash", "-c", "(sleep 5s ; cat)"}, |
| 93 | 93 | stdin_data = "this should appear after 5s.\n", |
| 94 | 94 | detach = true}, |
| 95 | − function(res, val, err) | |
| 95 | + function(_, val) | |
| 96 | 96 | print("5s test: " .. val.status) |
| 97 | 97 | end) |
| 98 | 98 | |