Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: buggy configure completion - when both --enable-foo and --disable-foo are listed
- X-seq: zsh-workers 39135
- From: Daniel Shahaf <d.s@xxxxxxxxxxxxxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: Re: buggy configure completion - when both --enable-foo and --disable-foo are listed
- Date: Wed, 31 Aug 2016 03:03:04 +0000
- Dkim-signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= daniel.shahaf.name; h=content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-sasl-enc:x-sasl-enc; s=mesmtp; bh=i0mJ4NpYqHHbuzt/ FjSoPDbRs6g=; b=dz0qMzdaOQucqyJsjtKVsFS++BnFczntU5zMN6Cjg5v/au2b DfOQt1F0GSij3eSPxT9DLKiq8crGcB9n6fnb3TH48ewzl5JGAqjXeHnhlb+sc1hO 8ZAmsEYX0s2ZEodeXwWMMFUYSC3tDlS/RQMYpHik1/MYNLhwRyBd4YTO82k=
- Dkim-signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-sasl-enc:x-sasl-enc; s=smtpout; bh=i0mJ4NpYqHHbuzt /FjSoPDbRs6g=; b=lTOtoiosrAGgeCrhQW9aBK7U75Or394TBhsVCfMLRXbbofp JEoCPrV4asRJq4fiz5866FJuy0zyebSVL2CmQwZ30SOadIqmHHm7t55uKT9Y4G4p 0LwQnkJEGI5unXzJ0BNsCt5dlCPNosYKsTKPqSwW3EqPDTPwKvdZmH/LMFtQ=
- In-reply-to: <20160830232332.GA23779@zira.vinc17.org>
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <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
Messages sorted by:
Reverse Date,
Date,
Thread,
Author