Merge pull request #1046 from sthulb/ssh-fix

Fix for SSH command
This commit is contained in:
Evan Hazlett 2015-04-22 05:40:18 -07:00
commit 5fc9b78b38
1 changed files with 14 additions and 1 deletions

View File

@ -65,7 +65,20 @@ func cmdSsh(c *cli.Context) {
if len(c.Args()) <= 1 {
err = host.CreateSSHShell()
} else {
output, err = host.RunSSHCommand(strings.Join(c.Args()[1:], " "))
var cmd string
var args []string = c.Args()
for i, arg := range args {
if arg == "--" {
i++
cmd = strings.Join(args[i:], " ")
break
}
}
if len(cmd) == 0 {
cmd = strings.Join(args[1:], " ")
}
output, err = host.RunSSHCommand(cmd)
io.Copy(os.Stderr, output.Stderr)
io.Copy(os.Stdout, output.Stdout)