zsh-workers
 help / color / mirror / code / Atom feed
From: Peter Stephenson <pws@csr.com>
To: Bill Allombert <allomber@math.u-bordeaux.fr>
Cc: 252233@bugs.debian.org, zsh-workers@sunsite.dk
Subject: Re: Bug#252233: zsh: filename completion after long options like --foo=
Date: Wed, 09 Jun 2004 10:51:38 +0100	[thread overview]
Message-ID: <200406090951.i599pcgE022261@news01.csr.com> (raw)
In-Reply-To: "Bill Allombert"'s message of "Wed, 02 Jun 2004 23:50:18 +0200." <20040602215018.GB5026@seventeen>

Bill Allombert wrote:
> On Wed, Jun 02, 2004 at 05:19:53PM -0400, Clint Adams wrote:
> > > I can reproduce the problem with a standard configure file:
> > > If a package use gettext (I tried with lostirc), configure says:
> > > ./configure --help
> > > ...
> > >   --with-libintl-prefix[=DIR]  search for libintl in DIR/include and
> > >   DIR/lib
> > > ...
> > > but ./configure --with-libintl-prefix= won't complete on directory.
> > 
> > So, if you remove the brackets from that line in ./configure, it works.
> 
> Yes, but it is highly impractical in this particular case since this
> text come from gettext files /usr/share/aclocal/lib-link.m4 and
> /usr/share/aclocal/lib-prefix.m4, just grep for "search for".
> 
> [] are used to denote optionnal arguments in the help messages.

I don't think editing configure is really an option...

Does the following help?  Calling the code obscure would be an insult to
some perfectly charming obscure features of other languages, and I don't
have a suitable package to test, but in the in the listing for zsh's
configure it seemed to be doing the right thing for
--with-PACKAGE=[ARG].

In case the lines get rewrapped, the change is the addition of an extra ${(@)
near the start of the first altered line, and the addition of //\[=/=}
near the end of the second.

Index: Completion/Base/Utility/_arguments
===================================================================
RCS file: /cvsroot/zsh/zsh/Completion/Base/Utility/_arguments,v
retrieving revision 1.15
diff -u -r1.15 _arguments
--- Completion/Base/Utility/_arguments	5 Jun 2003 09:51:32 -0000	1.15
+++ Completion/Base/Utility/_arguments	9 Jun 2004 09:47:25 -0000
@@ -67,9 +67,9 @@
     # those hyphens and anything from the space or tab after the
     # option up to the end.
 
-    lopts=("--${(@)^${(@)${(@)${(@M)${(@ps:\n:j:\n:)${(@)${(@M)${(@f)$(_call_program options ${~words[1]} --help 2>&1)//\[--/
+    lopts=("--${(@)${(@)^${(@)${(@)${(@M)${(@ps:\n:j:\n:)${(@)${(@M)${(@f)$(_call_program options ${~words[1]} --help 2>&1)//\[--/
 --}:#[ 	]#-*}//,/
-}}:#[ 	]#--*}#*--}%%[]	 ]*}:#}")
+}}:#[ 	]#--*}#*--}%%[]	 ]*}:#}//\[=/=}")
 
     # Remove options also described by user-defined specs.
 

-- 
Peter Stephenson <pws@csr.com>                  Software Engineer
CSR Ltd., Science Park, Milton Road,
Cambridge, CB4 0WH, UK                          Tel: +44 (0)1223 692070


**********************************************************************
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the system manager.

This footnote also confirms that this email message has been swept by
MIMEsweeper for the presence of computer viruses.

www.mimesweeper.com
**********************************************************************


      reply	other threads:[~2004-06-09  9:52 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20040602085613.GA4559@yellowpig.yi.org>
     [not found] ` <20040602132227.GB16405@scowler.net>
     [not found]   ` <20040602141018.GC5838@seventeen>
2004-06-02 14:37     ` Clint Adams
2004-06-02 16:39       ` Bill Allombert
2004-06-02 21:19         ` Clint Adams
2004-06-02 21:50           ` Bill Allombert
2004-06-09  9:51             ` Peter Stephenson [this message]

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=200406090951.i599pcgE022261@news01.csr.com \
    --to=pws@csr.com \
    --cc=252233@bugs.debian.org \
    --cc=allomber@math.u-bordeaux.fr \
    --cc=zsh-workers@sunsite.dk \
    /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).