zsh-workers
 help / color / mirror / code / Atom feed
From: Daniel Shahaf <d.s@daniel.shahaf.name>
To: zsh-workers@zsh.org
Subject: Re: buggy configure completion - when both --enable-foo and --disable-foo are listed
Date: Wed, 31 Aug 2016 03:03:04 +0000	[thread overview]
Message-ID: <20160831030304.GD30557@fujitsu.shahaf.local2> (raw)
In-Reply-To: <20160830232332.GA23779@zira.vinc17.org>

Vincent Lefevre wrote on Wed, Aug 31, 2016 at 01:23:32 +0200:
> And there is an inconsistency:
> 
> zira:~/software/mpfr> ./configure --enable-log[Tab]
> 
> gives
> 
> ./configure --enable-logging []
> 
> where [] is the cursor. But
> 
> zira:~/software/mpfr> ./configure --enable-gmp-int[Tab]
> 
> gives:
> 
> zira:~/software/mpfr> ./configure --enable-gmp-internals=[]
> 
> and
> 
> zira:~/software/mpfr> ./configure --enable-gmp-internals --[Tab]
> 
> gives:
> 
> zira:~/software/mpfr> ./configure --enable-gmp-internals --[]
> Completing --enable-gmp-internals
> 
> instead of completing a new option.

It thinks --enable-gmp-internals takes an argument.  This seems to
happen whenever there's an "=" sign on that line of the --help output.

>From the trace output:

+_arguments:143> lopts+=( '--enable-foo:enable fo=o' ) 
⋮
+_arguments:266> tmpo=( '--enable-foo:enable fo=o' '--disable-foo:enable fo=o' ) 
+_arguments:267> ((  2  ))
+_arguments:268> tmp=( ) 
+_arguments:270> opt=--enable-foo:enable fo=o
+_arguments:271> [[ '--enable-foo:enable fo=o' == (#b)(*):([^:]#) ]]
+_arguments:272> opt=--enable-foo 
+_arguments:273> odescr='[enable fo=o]' 
+_arguments:277> opt2='--enable-foo=[enable fo=o]' 

Line 143 is in the handling of "--help" parsing.  The other lines look
for --foo=[…]:… specs.  The pattern in 266/268 appears to match the
'=' sign even though it's in the second colon-separated field, where it
doesn't denote a mandatory argument.

I'm guessing the pattern match on lines 266/268 should be fixed, but I'm
not sure how.

Cheers,

Daniel


  parent reply	other threads:[~2016-08-31  3:03 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-30 23:23 buggy configure completion Vincent Lefevre
2016-08-31  3:00 ` buggy configure completion - when both --enable-foo and --disable-foo are listed Daniel Shahaf
2016-08-31  6:15   ` Vincent Lefevre
2016-08-31  9:09     ` Daniel Shahaf
2016-08-31 20:27   ` m0viefreak
2016-09-02  1:27     ` Bart Schaefer
2016-09-02 21:02       ` m0viefreak
2016-09-07  5:39         ` Bart Schaefer
2016-08-31  3:03 ` Daniel Shahaf [this message]
2016-08-31  6:45   ` Vincent Lefevre

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=20160831030304.GD30557@fujitsu.shahaf.local2 \
    --to=d.s@daniel.shahaf.name \
    --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).