MCPcopy Index your code
hub / github.com/docker/cli / Args

Method Args

cli/connhelper/ssh/ssh.go:85–101  ·  view source on GitHub ↗

Args returns args except "ssh" itself combined with optional additional command and args to be executed on the remote host. It attempts to quote the given arguments to account for ssh executing the remote command in a shell. It returns nil when unable to quote the remote command.

(remoteCommandAndArgs ...string)

Source from the content-addressed store, hash-verified

83// the given arguments to account for ssh executing the remote command in a
84// shell. It returns nil when unable to quote the remote command.
85func (sp *Spec) Args(remoteCommandAndArgs ...string) []string {
86 // Format the remote command to run using the ssh connection, quoting
87 // values where needed because ssh executes these in a POSIX shell.
88 remoteCommand, err := quoteCommand(remoteCommandAndArgs...)
89 if err != nil {
90 return nil
91 }
92
93 sshArgs, err := sp.args()
94 if err != nil {
95 return nil
96 }
97 if remoteCommand != "" {
98 sshArgs = append(sshArgs, remoteCommand)
99 }
100 return sshArgs
101}
102
103func (sp *Spec) args(sshFlags ...string) ([]string, error) {
104 var args []string

Callers 2

HandleGlobalFlagsMethod · 0.80
TestParseURLFunction · 0.80

Calls 2

argsMethod · 0.95
quoteCommandFunction · 0.85

Tested by 1

TestParseURLFunction · 0.64