zsh-workers
 help / color / mirror / code / Atom feed
* [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
@ 2021-07-05  5:11 Eric Cook
  2021-07-08 22:05 ` Oliver Kiddle
  0 siblings, 1 reply; 4+ messages in thread
From: Eric Cook @ 2021-07-05  5:11 UTC (permalink / raw)
  To: zsh-workers

% 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



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-07-19  6:19 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-05  5:11 [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 Eric Cook
2021-07-08 22:05 ` Oliver Kiddle
2021-07-18 22:46   ` Lawrence Velázquez
2021-07-19  6:18     ` Eric Cook

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).