From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24475 invoked by alias); 31 Aug 2016 03:03:30 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 39135 Received: (qmail 17986 invoked from network); 31 Aug 2016 03:03:30 -0000 X-Qmail-Scanner-Diagnostics: from out4-smtp.messagingengine.com by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.99.2/21882. spamassassin: 3.4.1. Clear:RC:0(66.111.4.28):SA:0(0.0/5.0):. Processed in 0.144169 secs); 31 Aug 2016 03:03:30 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.1 X-Envelope-From: d.s@daniel.shahaf.name X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | Received-SPF: none (ns1.primenet.com.au: domain at daniel.shahaf.name does not designate permitted sender hosts) 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= X-Sasl-enc: 82RXzJ6fGMWpsbKrSOGCATsqlNIUTCz4rB583rztE2Qp 1472612607 Date: Wed, 31 Aug 2016 03:03:04 +0000 From: Daniel Shahaf To: zsh-workers@zsh.org Subject: Re: buggy configure completion - when both --enable-foo and --disable-foo are listed Message-ID: <20160831030304.GD30557@fujitsu.shahaf.local2> References: <20160830232332.GA23779@zira.vinc17.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20160830232332.GA23779@zira.vinc17.org> User-Agent: Mutt/1.5.23 (2014-03-12) 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