zsh-workers
 help / color / mirror / Atom feed
* PATCH: completion of ssh ciphers and config options
@ 2020-08-13 22:19 Oliver Kiddle
  0 siblings, 0 replies; only message in thread
From: Oliver Kiddle @ 2020-08-13 22:19 UTC (permalink / raw)
  To: Zsh workers

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 \


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2020-08-13 22:20 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-13 22:19 PATCH: completion of ssh ciphers and config options Oliver Kiddle

zsh-workers

This inbox may be cloned and mirrored by anyone:

	git clone --mirror http://inbox.vuxu.org/zsh-workers

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V1 zsh-workers zsh-workers/ http://inbox.vuxu.org/zsh-workers \
		zsh-workers@zsh.org
	public-inbox-index zsh-workers

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://inbox.vuxu.org/vuxu.archive.zsh.workers


code repositories for the project(s) associated with this inbox:

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

AGPL code for this site: git clone https://public-inbox.org/public-inbox.git