From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13725 invoked by alias); 15 Aug 2015 16:56:26 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 36183 Received: (qmail 9579 invoked from network); 15 Aug 2015 16:56:25 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:subject:date:message-id; bh=hvfn+uFSRKkPu6k0l1/NdLODQ5Iz4ou+0pq4nky8sdA=; b=Nwu1+fwVSQiU13RT8srA0egXdSh1o0gtrn5mU/x/iwU4dVPTYn2dJcYJEMoPMSKDip UIH3BZSVvOOei5Ed6M6HVg3VOrEoDiQ+i5eg4jTbDr75Y2hMb96JEjjkh3gRvs44zmvI czHjT2vioVE75lTyNPI7ab1LMeHZM/nyJN8jg9V8HStAeltXQGMRzt5mGg7Ksn44hn6w /S8ykTM5cvj2ICtS0+INCWibOU/AwrMvUMpCDHe+oGNK77CYOxh7p0dljAjBMGehKuY5 M7K49dt51Xm+0z35Lp5lf+sYFj3H0NpMfGSiaTrc5mpYTu6suXx6HdmS7uzatSNHNZpC QEvg== X-Received: by 10.180.105.165 with SMTP id gn5mr17448810wib.20.1439657781644; Sat, 15 Aug 2015 09:56:21 -0700 (PDT) From: Mikael Magnusson To: zsh-workers@zsh.org Subject: PATCH: _ssh: update to 7.0 Date: Sat, 15 Aug 2015 18:56:15 +0200 Message-Id: <1439657775-18765-1-git-send-email-mikachu@gmail.com> X-Mailer: git-send-email 2.4.0 I remembered why those * were there that I removed in the previous patch, ssh lets you say -ooptionname= without the space. I had to remove it because *port matched transport too, so now I just strip -o specifically before matching. I don't think all the added short options are new, just missed those before. The +append syntax is new though, as well as the option. We should probably use ssh -Q in places that have hardcoded keys etc currently. --- Completion/Unix/Command/_ssh | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/Completion/Unix/Command/_ssh b/Completion/Unix/Command/_ssh index c2514a1..fae5679 100644 --- a/Completion/Unix/Command/_ssh +++ b/Completion/Unix/Command/_ssh @@ -1,6 +1,6 @@ #compdef ssh slogin=ssh scp ssh-add ssh-agent ssh-keygen sftp ssh-copy-id -# Completions currently based on OpenSSH 6.9 (released on 2015-06-30). +# Completions currently based on OpenSSH 7.0 (released on 2015-08-11). # # TODO: update ssh-keygen (not based on 5.9) # TODO: sshd, ssh-keyscan, ssh-keysign @@ -39,8 +39,10 @@ _ssh () { '(-P)-b+[specify interface to transmit on]:bind address:_bind_addresses' \ '-D+[specify a dynamic port forwarding]:dynamic port forwarding:->dynforward' \ '-e+[set escape character]:escape character (or `none'\''):' \ + '-E[append log output to file instead of stderr]:_files' \ '(-n)-f[go to background]' \ '-g[allow remote hosts to connect to local forwarded ports]' \ + '-G[output configuration and exit]' \ '-I+[specify smartcard device]:device:_files' \ '-K[enable GSSAPI-based authentication and forwarding]' \ '-k[disable forwarding of GSSAPI credentials]' \ @@ -56,11 +58,12 @@ _ssh () { '(-v)*-q[quiet operation]' \ '*-R[specify remote port forwarding]:remote port forwarding:->forward' \ '-S+[specify location of control socket for connection sharing]:path to control socket:_files' \ + '-Q[query parameters]:parameter type:((cipher\:"supported symmetric ciphers" cipher-auth\:"supported symmetric ciphers that support authenticated encryption" mac\:"supported message integrity codes" kex\:"key exchange algorithms" key\:"key types" protocol-version\:"supported SSH protocol versions"))' \ '(-1)-s[invoke subsystem]' \ '(-1 -t)-T[disable pseudo-tty allocation (protocol version 2 only)]' \ '(-T)-t[force pseudo-tty allocation]' \ '-V[show version number]' \ - '(-q)*-v[verbose mode]' \ + '(-q)*-v[verbose mode (multiple increase verbosity, up to 3)]' \ '-W[forward standard input and output to host]:stdinout forward:->hostport' \ '-w[request tunnel device forwarding]:local_tun[\:remote_tun] (integer or "any"):' \ '(-x -Y)-X[enable (untrusted) X11 forwarding]' \ @@ -147,7 +150,14 @@ _ssh () { case "$lstate" in option) if compset -P '*='; then - case "$IPREFIX" in + case "${IPREFIX#-o}" in + (#i)(ciphers|macs|kexalgorithms|hostkeyalgorithms|pubkeyacceptedkeytypes|hostbasedkeytypes)=) + if ! compset -P +; then + _wanted append expl 'append to default' compadd + && ret=0 + fi + ;; + esac + case "${IPREFIX#-o}" in (#i)(afstokenpassing|batchmode|canonicalizefallbacklocal|challengeresponseauthentication|checkhostip|clearallforwardings|compression|enablesshkeysign|exitonforwardfailure|fallbacktorsh|forward(agent|x11)|forwardx11trusted|gatewayports|gssapiauthentication|gssapidelegatecredentials|gssapitrustdns|hashknownhosts|hostbasedauthentication|identitiesonly|kbdinteractiveauthentication|(tcp|)keepalive|nohostauthenticationforlocalhost|passwordauthentication|permitlocalcommand|proxyusefdpass|pubkeyauthentication|rhosts(|rsa)authentication|rsaauthentication|streamlocalbindunlink|usersh|kerberos(authentication|tgtpassing)|useprivilegedport|visualhostkey)=*) _wanted values expl 'truth value' compadd yes no && ret=0 ;; @@ -234,7 +244,7 @@ _ssh () { (#i)hostname=*) _wanted hosts expl 'real host name to log into' _ssh_hosts && ret=0 ;; - (#i)(hostbasedkeytypes|hostkeyalgorithms)=*) + (#i)(hostbasedkeytypes|hostkeyalgorithms|pubkeyacceptedkeytypes)=*) _values -s , 'key types' \ 'ecdsa-sha2-nistp256-cert-v01@openssh.com' \ 'ecdsa-sha2-nistp384-cert-v01@openssh.com' \ @@ -450,6 +460,7 @@ _ssh () { Protocol \ ProxyCommand \ ProxyUseFdpass \ + PubkeyAcceptedKeyTypes \ PubkeyAuthentication \ RekeyLimit \ RemoteForward \ -- 2.4.0