zsh-workers
 help / color / mirror / code / Atom feed
From: dana <dana@dana.is>
To: Zsh hackers list <zsh-workers@zsh.org>
Cc: Oliver Kiddle <okiddle@yahoo.co.uk>
Subject: [PATCH] Fix `_description -J`
Date: Wed, 18 Sep 2019 04:15:54 -0500	[thread overview]
Message-ID: <0D8A1750-C2FE-4DB1-A330-9B2805FC1D40@dana.is> (raw)

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


                 reply	other threads:[~2019-09-18  9:15 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=0D8A1750-C2FE-4DB1-A330-9B2805FC1D40@dana.is \
    --to=dana@dana.is \
    --cc=okiddle@yahoo.co.uk \
    --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).