@@ -13,8 +13,9 @@ import (
13
13
)
14
14
15
15
type SSHConfig struct {
16
- ConfigFile string
17
- Persist bool
16
+ ConfigFile string
17
+ Persist bool
18
+ AdditionalArgs []string
18
19
}
19
20
20
21
func (c * SSHConfig ) Binary () string {
@@ -34,6 +35,7 @@ func (c *SSHConfig) Args() []string {
34
35
"-o" , "ControlPersist=yes" ,
35
36
)
36
37
}
38
+ args = append (args , c .AdditionalArgs ... )
37
39
return args
38
40
}
39
41
@@ -53,9 +55,9 @@ func ExitMaster(host string, port int, c *SSHConfig) error {
53
55
return nil
54
56
}
55
57
56
- // parseScriptInterpreter extracts "#!/bin/sh" interpreter string from the script.
58
+ // ParseScriptInterpreter extracts "#!/bin/sh" interpreter string from the script.
57
59
// The result does not contain the "#!" prefix.
58
- func parseScriptInterpreter (script string ) (string , error ) {
60
+ func ParseScriptInterpreter (script string ) (string , error ) {
59
61
r := bufio .NewReader (strings .NewReader (script ))
60
62
firstLine , partial , err := r .ReadLine ()
61
63
if err != nil {
@@ -82,7 +84,7 @@ func ExecuteScript(host string, port int, c *SSHConfig, script, scriptName strin
82
84
if c == nil {
83
85
return "" , "" , errors .New ("got nil SSHConfig" )
84
86
}
85
- interpreter , err := parseScriptInterpreter (script )
87
+ interpreter , err := ParseScriptInterpreter (script )
86
88
if err != nil {
87
89
return "" , "" , err
88
90
}
0 commit comments