zsh-workers
 help / color / mirror / code / Atom feed
From: Eric Cook <llua@gmx.com>
To: zsh-workers@zsh.org
Subject: [PATCH] _modutils: fix the testing of -R/--resolve-alias options as it is now, it is always true due to how $+var works with the k subscript flag on associative arrays
Date: Mon,  5 Jul 2021 01:11:49 -0400	[thread overview]
Message-ID: <20210705051149.12522-1-llua@gmx.com> (raw)

% typeset -A foo=(bar baz); print -- ${foo[(k)-R]} - ${+foo[(k)-R]}; typeset -A foo=(bar bar -R qux); print -- ${foo[(k)-R]} - ${+foo[(k)-R]}
- 1
qux - 1

---
 Completion/Linux/Command/_modutils | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Completion/Linux/Command/_modutils b/Completion/Linux/Command/_modutils
index c62c6e7b6..1205f2506 100644
--- a/Completion/Linux/Command/_modutils
+++ b/Completion/Linux/Command/_modutils
@@ -132,7 +132,7 @@ _modutils() {
 	_store_cache modules-$kver modules modaliases
       fi

-      if (( ${+opt_args[(k)(-R|--resolve-alias)]} )); then
+      if [[ -v opt_args[(i)(-R|--resolve-alias)] ]]; then
 	_tags module-aliases
       else
 	_tags files modules module-aliases
--
2.31.1



             reply	other threads:[~2021-07-05  5:12 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-05  5:11 Eric Cook [this message]
2021-07-08 22:05 ` Oliver Kiddle
2021-07-18 22:46   ` Lawrence Velázquez
2021-07-19  6:18     ` Eric Cook

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=20210705051149.12522-1-llua@gmx.com \
    --to=llua@gmx.com \
    --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).