zsh-workers
 help / color / mirror / code / Atom feed
From: Oliver Kiddle <opk@zsh.org>
To: Zsh workers <zsh-workers@zsh.org>
Subject: PATCH: completion of ssh ciphers and config options
Date: Fri, 14 Aug 2020 00:19:59 +0200	[thread overview]
Message-ID: <10961-1597357199.216717@mux_.IPEp.KYvI> (raw)

The ssh completion allows for prefixing the list of ciphers with + to
append to the default but should also allow for a - prefix to remove
from the default. Also in this patch is a matching control for the
ssh_config options.

Oliver

diff --git a/Completion/Unix/Command/_ssh b/Completion/Unix/Command/_ssh
index 0775590e6..642f11bcb 100644
--- a/Completion/Unix/Command/_ssh
+++ b/Completion/Unix/Command/_ssh
@@ -269,8 +269,8 @@ _ssh () {
       if compset -P 1 '*='; then
         case "${IPREFIX#-o}" in
           (#i)(ciphers|macs|kexalgorithms|hostkeyalgorithms|pubkeyacceptedkeytypes|hostbasedkeytypes)=)
-          if ! compset -P +; then
-            _wanted append expl 'append to default' compadd + && ret=0
+          if ! compset -P '[+-]'; then
+            _wanted prefix expl 'relative to default' compadd - + - && ret=0
           fi
           ;;
         esac
@@ -475,7 +475,7 @@ _ssh () {
       else
         # old options are after the empty "\"-line
         _wanted values expl 'configure file option' \
-            compadd -M 'm:{a-z}={A-Z}' -q -S '=' - \
+            compadd -M 'm:{a-z}={A-Z} r:[^A-Z]||[A-Z]=* r:|=*' -q -S '=' - \
                 AddKeysToAgent \
                 AddressFamily \
                 BatchMode \


                 reply	other threads:[~2020-08-13 22:20 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=10961-1597357199.216717@mux_.IPEp.KYvI \
    --to=opk@zsh.org \
    --cc=zsh-workers@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).