Documentation
¶
Index ¶
- Variables
- func EntryPoint(parent *cli.Command)
- func GetSSHCLI() (boolean_ssh_args *utils.Set[string], other_ssh_args *utils.Set[string])
- func ParseSSHArgs(args []string, extra_args ...string) (ssh_args []string, server_args []string, passthrough bool, ...)
- func PassthroughArgs() map[string]bool
- func RunSSHAskpass() int
- func TestEntryPoint(root *cli.Command)
- type ConfigSet
- type CopyInstruction
- type EnvInstruction
- type ErrInvalidSSHArgs
- type KittyOpts
- type SSHVersion
Constants ¶
This section is empty.
Variables ¶
View Source
var GetSSHVersion = sync.OnceValue(func() SSHVersion { b, err := exec.Command(SSHExe(), "-V").CombinedOutput() if err != nil { return SSHVersion{} } m := regexp.MustCompile(`OpenSSH_(\d+).(\d+)`).FindSubmatch(b) if len(m) == 3 { maj, _ := strconv.Atoi(utils.UnsafeBytesToString(m[1])) min, _ := strconv.Atoi(utils.UnsafeBytesToString(m[2])) return SSHVersion{Major: maj, Minor: min} } return SSHVersion{} })
View Source
var RelevantKittyOpts = sync.OnceValue(func() KittyOpts {
return read_relevant_kitty_opts()
})
View Source
var SSHOptions = sync.OnceValue(func() (ssh_options map[string]string) { defer func() { if ssh_options == nil { ssh_options = map[string]string{ "4": "", "6": "", "A": "", "a": "", "C": "", "f": "", "G": "", "g": "", "K": "", "k": "", "M": "", "N": "", "n": "", "q": "", "s": "", "T": "", "t": "", "V": "", "v": "", "X": "", "x": "", "Y": "", "y": "", "B": "bind_interface", "b": "bind_address", "c": "cipher_spec", "D": "[bind_address:]port", "E": "log_file", "e": "escape_char", "F": "configfile", "I": "pkcs11", "i": "identity_file", "J": "[user@]host[:port]", "L": "address", "l": "login_name", "m": "mac_spec", "O": "ctl_cmd", "o": "option", "p": "port", "Q": "query_option", "R": "address", "S": "ctl_path", "W": "host:port", "w": "local_tun[:remote_tun]", } } }() cmd := exec.Command(SSHExe()) var stdout, stderr bytes.Buffer cmd.Stdout = &stdout cmd.Stderr = &stderr _ = cmd.Run() text := stderr.String() if text == "" || strings.Contains(text, "OpenSSL version mismatch.") { return } ssh_options = make(map[string]string, 32) for { pos := strings.IndexByte(text, '[') if pos < 0 { break } num := 1 epos := pos for num > 0 { epos++ switch text[epos] { case '[': num += 1 case ']': num -= 1 } } q := text[pos+1 : epos] text = text[epos:] if len(q) < 2 || !strings.HasPrefix(q, "-") { continue } opt, desc, found := strings.Cut(q, " ") if found { ssh_options[opt[1:]] = desc } else { for _, ch := range opt[1:] { ssh_options[string(ch)] = "" } } } return })
Functions ¶
func EntryPoint ¶
func ParseSSHArgs ¶
func PassthroughArgs ¶
func RunSSHAskpass ¶
func RunSSHAskpass() int
func TestEntryPoint ¶
Types ¶
type CopyInstruction ¶
type CopyInstruction struct {
// contains filtered or unexported fields
}
func ParseCopyInstruction ¶
func ParseCopyInstruction(spec string) (ans []*CopyInstruction, err error)
type EnvInstruction ¶
type EnvInstruction struct {
// contains filtered or unexported fields
}
func ParseEnvInstruction ¶
func ParseEnvInstruction(spec string) (ans []*EnvInstruction, err error)
type ErrInvalidSSHArgs ¶
type ErrInvalidSSHArgs struct {
Msg string
}
func (*ErrInvalidSSHArgs) Error ¶
func (self *ErrInvalidSSHArgs) Error() string
type SSHVersion ¶
type SSHVersion struct{ Major, Minor int }
func (SSHVersion) SupportsAskpassRequire ¶
func (self SSHVersion) SupportsAskpassRequire() bool
Click to show internal directories.
Click to hide internal directories.