ProxyCommand replaces %%, %h, %p, and %r in the given command. %% A literal `%`. %h The remote hostname. %p The remote port. %r The remote username.
(cmd, user, host, port string)
| 23 | // %p The remote port. |
| 24 | // %r The remote username. |
| 25 | func ProxyCommand(cmd, user, host, port string) string { |
| 26 | cmd = strings.ReplaceAll(cmd, "%%", "%") |
| 27 | cmd = strings.ReplaceAll(cmd, "%h", host) |
| 28 | cmd = strings.ReplaceAll(cmd, "%p", port) |
| 29 | return strings.ReplaceAll(cmd, "%r", user) |
| 30 | } |
| 31 | |
| 32 | // ShellOption is the type used to add new options to the shell. |
| 33 | type ShellOption func(s *Shell) error |
no outgoing calls
no test coverage detected
searching dependent graphs…