Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

[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



% 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





Messages sorted by: Reverse Date, Date, Thread, Author