MCPcopy
hub / github.com/smallstep/cli / ProxyCommand

Function ProxyCommand

internal/sshutil/shell.go:25–30  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

23// %p The remote port.
24// %r The remote username.
25func 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.
33type ShellOption func(s *Shell) error

Callers 1

proxyBastionFunction · 0.92

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…