MCPcopy
hub / github.com/cli/cli / ParseSSHArgs

Function ParseSSHArgs

internal/codespaces/ssh.go:100–102  ·  view source on GitHub ↗

ParseSSHArgs parses the given array of arguments into two distinct slices of flags and command. The ssh command syntax is: ssh [flags] user@host command [args...] There is no way to specify the user@host destination as a flag. Unfortunately, that means we need to know which user-provided words are S

(args []string)

Source from the content-addressed store, hash-verified

98// them before or after the destination, and that means we need to know all
99// the flags and their arities.
100func ParseSSHArgs(args []string) (cmdArgs, command []string, err error) {
101 return parseArgs(args, "bcDeFIiLlmOopRSWw")
102}
103
104// newSCPCommand populates an exec.Cmd to run an scp command for the files specified in cmdArgs.
105// cmdArgs is parsed such that scp flags precede the files to copy in the command.

Callers 3

SSHMethod · 0.92
NewRemoteCommandFunction · 0.85
TestParseSSHArgsFunction · 0.85

Calls 1

parseArgsFunction · 0.85

Tested by 1

TestParseSSHArgsFunction · 0.68