Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
[patch] Associative array suffix in command position
- X-seq: zsh-workers 43185
- From: Matthew Martin <phy1729@xxxxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: [patch] Associative array suffix in command position
- Date: Wed, 18 Jul 2018 06:54:34 -0500
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:subject:message-id:mail-followup-to:mime-version :content-disposition:user-agent; bh=fzSwYcKOflPpVUdhsW6GZUkhsiQc3QfgVoAK+J0InyM=; b=tiUKN0hZfnjicB8sXYsAOuua/4b8NZ2hRkJlVhQEiDMMVe9cJ99G483yQ+EfxIK3Im OS5IQQcJpg6CXMrjxr+QGZ7hCCIsvJYhwyZccUTROT7V9SjLWSsKV7TtEJNZOIqPIBtq IOld4giALUReA3XFCrWTgkB76/Hcg0sa+is9FSC57bY+4Q3UiWvIFcGUzeltrfyTi9cq 4OTY3QYq9YdTKglJHbeVNdlwsaCfUq/kROrjc5BHAW3GLX7HDGXJkHSLb+xgbkPlYutl FGZSDj05S7M6484z0CI9USBWquhBbeR8RFHw1eKfMEeO6CRehRX+r5uO/B64Vzx+UE5V +0NQ==
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- List-unsubscribe: <mailto:zsh-workers-unsubscribe@zsh.org>
- Mail-followup-to: zsh-workers@xxxxxxx
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
When completing an associative array in the command position = is used
as the suffix. I think it's more likely (at least in my own usage) that
the user only wants to change a single key not the entire array. Thus
use [ as the suffix not =. There could be a zstyle knob to pick = or [,
but I don't think it'd be used. So unless someone speaks up, I'm
inclined to omit the knob.
- Matthew Martin
diff --git a/Completion/Zsh/Type/_command_names b/Completion/Zsh/Type/_command_names
index 940f341cb..96ea57687 100644
--- a/Completion/Zsh/Type/_command_names
+++ b/Completion/Zsh/Type/_command_names
@@ -31,7 +31,8 @@ else
'suffix-aliases:suffix alias:_suffix_alias_files'
'reserved-words:reserved word:compadd -Qk reswords'
'jobs:: _jobs -t'
- 'parameters:: _parameters -g "^*readonly*" -qS= -r "\n\t\- =["'
+ 'parameters:: _parameters -g "^*(readonly|association)*" -qS= -r "\n\t\- =["'
+ 'parameters:: _parameters -g "*association*~*readonly*" -qS\[ -r "\n\t\- =["'
)
fi
Messages sorted by:
Reverse Date,
Date,
Thread,
Author