From 65c1c84ee1c839375c45786a715eba1b938ca176 Mon Sep 17 00:00:00 2001 From: Carter Date: Fri, 26 Jun 2020 12:16:41 -0700 Subject: [PATCH] Add run_opts to SSHKit.run with default empty list This would allow us to do things like setup a custom capture function for messages while still getting to use the higher level contexts abstraction. --- lib/sshkit.ex | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/sshkit.ex b/lib/sshkit.ex index 568bb860..2763082b 100644 --- a/lib/sshkit.ex +++ b/lib/sshkit.ex @@ -307,12 +307,12 @@ defmodule SSHKit do assert "Hello World!\n" == stdout ``` """ - def run(context, command) do + def run(context, command, run_opts = [] \\ []) do cmd = Context.build(context, command) run = fn host -> {:ok, conn} = SSH.connect(host.name, host.options) - res = SSH.run(conn, cmd) + res = SSH.run(conn, cmd, run_opts) :ok = SSH.close(conn) res end