diff --git a/ssh.lua b/ssh.lua index 0af751d..cd715cf 100644 --- a/ssh.lua +++ b/ssh.lua @@ -160,6 +160,31 @@ local function supportedMACs(token) -- luacheck: no unused args return macs end +-- return the list of supported options +local function supportedOptions(token) -- luacheck: no unused args +-- curl --silent https://raw.githubusercontent.com/openssh/openssh-portable/master/ssh_config.5 | awk '$1==".It" && $2=="Cm" && $3!="Host" && $3!="Match" {print " "$3}' | sort + local options = {"AddKeysToAgent", "AddressFamily", "BatchMode", "BindAddress", "BindInterface", + "CanonicalDomains", "CanonicalizeFallbackLocal", "CanonicalizeHostname", "CanonicalizeMaxDots", + "CanonicalizePermittedCNAMEs", "CASignatureAlgorithms", "CertificateFile", "CheckHostIP", + "Ciphers", "ClearAllForwardings", "Compression", "ConnectionAttempts", "ConnectTimeout", + "ControlMaster", "ControlPath", "ControlPersist", "DynamicForward", "EnableEscapeCommandline", + "EnableSSHKeysign", "EscapeChar", "ExitOnForwardFailure", "FingerprintHash", "ForkAfterAuthentication", + "ForwardAgent", "ForwardX11", "ForwardX11Timeout", "ForwardX11Trusted", "GatewayPorts", + "GlobalKnownHostsFile", "GSSAPIAuthentication", "GSSAPIDelegateCredentials", "HashKnownHosts", + "HostbasedAcceptedAlgorithms", "HostbasedAuthentication", "HostKeyAlgorithms", "HostKeyAlias", + "Hostname", "IdentitiesOnly", "IdentityAgent", "IdentityFile", "IgnoreUnknown", "Include", + "IPQoS", "KbdInteractiveAuthentication", "KbdInteractiveDevices", "KexAlgorithms", "KnownHostsCommand", + "LocalCommand", "LocalForward", "LogLevel", "LogVerbose", "MACs", "NoHostAuthenticationForLocalhost", + "NumberOfPasswordPrompts", "ObscureKeystrokeTiming", "PasswordAuthentication", "PermitLocalCommand", + "PermitRemoteOpen", "PKCS11Provider", "Port", "PreferredAuthentications", "ProxyCommand", "ProxyJump", + "ProxyUseFdpass", "PubkeyAcceptedAlgorithms", "PubkeyAuthentication", "RekeyLimit", "RemoteCommand", + "RemoteForward", "RequestTTY", "RequiredRSASize", "RevokedHostKeys", "SecurityKeyProvider", "SendEnv", + "ServerAliveCountMax", "ServerAliveInterval", "SessionType", "SetEnv", "StdinNull", "StreamLocalBindMask", + "StreamLocalBindUnlink", "StrictHostKeyChecking", "SyslogFacility", "Tag", "TCPKeepAlive", "Tunnel", + "TunnelDevice", "UpdateHostKeys", "User", "UserKnownHostsFile", "VerifyHostKeyDNS", "VisualHostKey", "XAuthLocation"} + return options +end + local ssh_parser = parser({hosts_with_port_flag}, "-4", "-6", "-A", "-a", "-C", "-f", "-G", "-g", "-K", "-k", "-M", "-N", "-n", "-q", "-s", "-T", "-t", "-V", "-v", "-X", "-x", "-Y", "-y", @@ -177,7 +202,7 @@ local ssh_parser = parser({hosts_with_port_flag}, "-l" .. parser({fromhistory=true}), "-m" .. parser({supportedMACs}), "-O" .. parser({fromhistory=true}), - "-o" .. parser({fromhistory=true}), + "-o" .. parser({supportedOptions}), "-p" .. parser({fromhistory=true}), "-Q" .. parser({"cipher", "cipher_auth", "help", "mac", "kex", "kex-gss", "key", "key-cert", "key-plain", "key-sig", "protocol-version", "sig"}), -- luacheck: no max line length "-R" .. parser({fromhistory=true}),