diff options
Diffstat (limited to 'completions/ssh')
-rw-r--r-- | completions/ssh | 75 |
1 files changed, 64 insertions, 11 deletions
diff --git a/completions/ssh b/completions/ssh index aaa10346..ecbd5896 100644 --- a/completions/ssh +++ b/completions/ssh @@ -3,7 +3,7 @@ _ssh_queries() { COMPREPLY+=( $(compgen -W \ - "cipher cipher-auth mac kex key key-cert key-plain protocol-version" \ + "cipher cipher-auth mac kex key key-cert key-plain protocol-version sig" \ -- "$cur") ) } @@ -34,7 +34,7 @@ _ssh_options() local opts=( AddKeysToAgent AddressFamily BatchMode BindAddress CanonicalDomains CanonicalizeFallbackLocal CanonicalizeHostname CanonicalizeMaxDots - CanonicalizePermittedCNAMEs CertificateFile + CanonicalizePermittedCNAMEs CASignatureAlgorithms CertificateFile ChallengeResponseAuthentication CheckHostIP Ciphers ClearAllForwardings Compression ConnectionAttempts ConnectTimeout ControlMaster ControlPath ControlPersist DynamicForward EnableSSHKeysign EscapeChar @@ -90,10 +90,10 @@ _ssh_suboption() gssapidelegatecredentials|gssapirenewalforcesrekey|gssapitrustdns|\ hashknownhosts|hostbasedauthentication|identitiesonly|\ kbdinteractiveauthentication|kbdinteractivedevices|\ - nohostauthenticationforlocalhost|passwordauthentication|\ + nohostauthenticationforlocalhost|passwordauthentication|permitlocalcommand|\ proxyusefdpass|pubkeyauthentication|rhostsrsaauthentication|\ - rsaauthentication|stricthostkeychecking|streamlocalbindunlink|\ - tcpkeepalive|useprivilegedport|verifyhostkeydns|visualhostkey) + rsaauthentication|streamlocalbindunlink|\ + tcpkeepalive|useprivilegedport|visualhostkey) COMPREPLY=( $(compgen -W 'yes no' -- "$cur") ) ;; addkeystoagent) @@ -108,15 +108,24 @@ _ssh_suboption() canonicalizehostname) COMPREPLY=( $(compgen -W 'yes no always' -- "$cur") ) ;; - *file|identityagent|include) + identityfile) + _ssh_identityfile + ;; + *file|identityagent|include|controlpath|revokedhostkeys|xauthlocation) _filedir ;; + casignaturealgorithms) + COMPREPLY=( $(compgen -W '$(_ssh_query "$2" sig)' -- "$cur") ) + ;; cipher) COMPREPLY=( $(compgen -W 'blowfish des 3des' -- "$cur") ) ;; ciphers) _ssh_ciphers "$2" ;; + controlmaster) + COMPREPLY=( $(compgen -W 'yes ask auto autoask no' -- "$cur") ) + ;; compressionlevel) COMPREPLY=( $(compgen -W '{1..9}' -- "$cur") ) ;; @@ -133,9 +142,15 @@ _ssh_suboption() kexalgorithms) COMPREPLY=( $(compgen -W '$(_ssh_query "$2" kex)' -- "$cur") ) ;; + loglevel) + COMPREPLY=( $(compgen -W 'QUIET FATAL ERROR INFO VERBOSE DEBUG{,1,2,3}' -- "$cur") ) + ;; macs) _ssh_macs "$2" ;; + pkcs11provider) + _filedir so + ;; preferredauthentications) COMPREPLY=( $(compgen -W 'gssapi-with-mic host-based publickey keyboard-interactive password' -- "$cur") ) @@ -150,12 +165,18 @@ _ssh_suboption() proxyjump) _known_hosts_real -a -F "$configfile" -- "$cur" ;; + proxycommand|remotecommand|localcommand) + COMPREPLY=( $(compgen -c -- "$cur") ) + ;; pubkeyacceptedkeytypes) COMPREPLY=( $(compgen -W '$(_ssh_query "$2" key)' -- "$cur") ) ;; requesttty) COMPREPLY=( $(compgen -W 'no yes force auto' -- "$cur") ) ;; + stricthostkeychecking) + COMPREPLY=( $(compgen -W 'accept-new ask no off' -- "$cur") ) + ;; syslogfacility) COMPREPLY=( $(compgen -W 'DAEMON USER AUTH LOCAL{0..7}' -- "$cur") ) ;; @@ -163,7 +184,7 @@ _ssh_suboption() COMPREPLY=( $(compgen -W 'yes no point-to-point ethernet' \ -- "$cur") ) ;; - updatehostkeys) + updatehostkeys|verifyhostkeydns) COMPREPLY=( $(compgen -W 'yes no ask' -- "$cur") ) ;; esac @@ -202,6 +223,17 @@ _ssh_configfile() done } +# With $1 set, look for public key files, else private +_ssh_identityfile() +{ + [[ -z $cur && -d ~/.ssh ]] && cur=~/.ssh/id + _filedir + if (( ${#COMPREPLY[@]} > 0 )); then + COMPREPLY=( $(compgen -W '${COMPREPLY[@]}' \ + -X "${1:+!}*.pub" -- "$cur") ) + fi +} + _ssh() { local cur prev words cword @@ -234,10 +266,14 @@ _ssh() -*[DeLpRW]) return ;; - -*[EFiS]) + -*[EFS]) _filedir return ;; + -*i) + _ssh_identityfile + return + ;; -*I) _filedir so return @@ -255,7 +291,7 @@ _ssh() return ;; -*O) - COMPREPLY=( $(compgen -W 'check forward exit stop' -- "$cur") ) + COMPREPLY=( $(compgen -W 'check forward cancel exit stop' -- "$cur") ) return ;; -*o) @@ -317,14 +353,22 @@ _sftp() -*[BDlPRs]) return ;; - -*[bFi]) + -*[bF]) _filedir return ;; + -*i) + _ssh_identityfile + return + ;; -*c) _ssh_ciphers return ;; + -*J) + _known_hosts_real -a -F "$configfile" -- "$cur" + return + ;; -*o) _ssh_options return @@ -442,11 +486,20 @@ _scp() COMPREPLY=( "${COMPREPLY[@]/%/ }" ) return ;; - -*[Fi]) + -*F) _filedir compopt +o nospace return ;; + -*i) + _ssh_identityfile + compopt +o nospace + return + ;; + -*J) + _known_hosts_real -a -F "$configfile" -- "$cur" + return + ;; -*[lP]) return ;; |