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

[PATCH] Fix `_description -J`



I noticed that workers/44274 introduced a bug related to `_description -J`.
When invoked this way, the function now adds -J to expl twice, yielding
something like...

  -J -J foo -X 'completing foo:'

... which breaks completion.

Can we simply do this? My brain is too muddy right now to understand the full
implications, but it seems like it should work...?

(Can't remember why i actually wanted to use `_description -J`; just found it
in one of my functions)

dana


diff --git a/Completion/Base/Core/_description b/Completion/Base/Core/_description
index c2a0e080b..bdb4007a6 100644
--- a/Completion/Base/Core/_description
+++ b/Completion/Base/Core/_description
@@ -1,13 +1,13 @@
 #autoload
 
 local name nopt xopt format gname hidden hide match opts tag
-local -a gropt sort
+local -a ign gropt sort
 
 opts=()
 
 xopt=(-X)
 nopt=()
-zparseopts -K -D -a nopt 1 2 V=gropt J x=xopt
+zparseopts -K -D -a nopt 1 2 V=gropt J=ign x=xopt
 
 3="${${3##[[:blank:]]#}%%[[:blank:]]#}"
 [[ -n "$3" ]] && _lastdescr=( "$_lastdescr[@]" "$3" )



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