@@ -36,11 +36,11 @@ import (
3636const EnvShellSSH = "SSH"
3737
3838type SSHExe struct {
39- Executable string
40- Args []string
39+ Exe string
40+ Args []string
4141}
4242
43- func SSHArguments () (SSHExe , error ) {
43+ func NewSSHExe () (SSHExe , error ) {
4444 var sshExe SSHExe
4545
4646 if sshShell := os .Getenv (EnvShellSSH ); sshShell != "" {
@@ -50,7 +50,7 @@ func SSHArguments() (SSHExe, error) {
5050 logrus .WithError (err ).Warnf ("Failed to split %s variable into shell tokens. " +
5151 "Falling back to 'ssh' command" , EnvShellSSH )
5252 case len (sshShellFields ) > 0 :
53- sshExe .Executable = sshShellFields [0 ]
53+ sshExe .Exe = sshShellFields [0 ]
5454 if len (sshShellFields ) > 1 {
5555 sshExe .Args = sshShellFields [1 :]
5656 }
@@ -62,7 +62,7 @@ func SSHArguments() (SSHExe, error) {
6262 if err != nil {
6363 return SSHExe {}, err
6464 }
65- sshExe .Executable = executable
65+ sshExe .Exe = executable
6666
6767 return sshExe , nil
6868}
@@ -376,7 +376,7 @@ func detectOpenSSHInfo(sshExe SSHExe) openSSHInfo {
376376 )
377377 // TODO: Fix this function to properly handle complex SSH commands like "kitten ssh"
378378 // The current LookPath, os.Stat, and caching logic doesn't work well for multi-word commands
379- path , err := exec .LookPath (sshExe .Executable )
379+ path , err := exec .LookPath (sshExe .Exe )
380380 if err != nil {
381381 logrus .Warnf ("failed to find ssh executable: %v" , err )
382382 } else {
@@ -391,7 +391,7 @@ func detectOpenSSHInfo(sshExe SSHExe) openSSHInfo {
391391 }
392392 // -V should be last
393393 allArgs := append (sshExe .Args , "-o" , "GSSAPIAuthentication=no" , "-V" )
394- cmd := exec .Command (sshExe .Executable , allArgs ... )
394+ cmd := exec .Command (sshExe .Exe , allArgs ... )
395395 cmd .Stderr = & stderr
396396 if err := cmd .Run (); err != nil {
397397 logrus .Warnf ("failed to run %v: stderr=%q" , cmd .Args , stderr .String ())
0 commit comments