From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16844 invoked from network); 5 Mar 1999 09:44:16 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 5 Mar 1999 09:44:16 -0000 Received: (qmail 3413 invoked by alias); 5 Mar 1999 09:44:04 -0000 Mailing-List: contact zsh-workers-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 5650 Received: (qmail 3405 invoked from network); 5 Mar 1999 09:44:01 -0000 From: "Andrej Borsenkow" To: "ZSH workers mailing list" Subject: PATCH: zsh-3.1.5-pws-10: _configure completion Date: Fri, 5 Mar 1999 12:41:58 +0300 Message-ID: <000d01be66ec$69c33b70$21c9ca95@mowp.siemens.ru> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_NextPart_000_000E_01BE6705.8F107370" X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2910.0) Importance: Normal X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2013.2901 This is a multi-part message in MIME format. ------=_NextPart_000_000E_01BE6705.8F107370 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit This patch tries to be a bit smarter. - it is using matching control, so --e-z-m completes to --enable-zsh-mem* - it tries to guess (basing on --help output) if parameter takes an argument and appends ``=''. If argument is indicated as optional, ``='' is autoremoved. I'm gonna like this new stuff, really :-) /andrej ------=_NextPart_000_000E_01BE6705.8F107370 Content-Type: application/octet-stream; name="_configure.patch" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="_configure.patch" --- Completion/User/_configure Thu Mar 4 19:27:03 1999=0A= +++ /home/bor/.zsh.d/Completion/User/_configure Fri Mar 5 12:27:58 1999=0A= @@ -1,5 +1,7 @@=0A= #defcomp configure=0A= =0A= +setopt localoptions extendedglob=0A= +=0A= if [[ $PREFIX =3D *=3D* ]]; then=0A= # Complete filenames after e.g. --prefix=3D=0A= IPREFIX=3D${PREFIX%%=3D*}=3D=0A= @@ -7,6 +9,27 @@=0A= compgen -f=0A= else=0A= # Generate a list of options from configure --help=0A= - compgen -s '$($words[1] --help |=0A= - sed -n -e '\''s/^ *\(--[-a-z0-9]*\)[ =3D,].*$/\1/p'\'')'=0A= + local -a pars=0A= + local i=0A= + pars=3D($($words[1] --help | awk '$1 ~ /--[a-z]*.*/ {print $1}'))=0A= + for i in $pars=0A= + do=0A= + case $i in=0A= + (--(((en|dis)able-FEATURE)|(with(out|)-PACKAGE))*)=0A= + : Skip standard help output=0A= + ;;=0A= + --enable)=0A= + : Skip standard help output=0A= + ;;=0A= + --*\[=3D* )=0A= + compadd -M 'r:|-=3D* r:|=3D*' -q -S =3D -- ${i%%\[=3D*}=0A= + ;;=0A= + --*=3D* )=0A= + compadd -M 'r:|-=3D* r:|=3D*' -S =3D -- ${i%%=3D*}=0A= + ;;=0A= + * )=0A= + compadd -M 'r:|-=3D* r:|=3D*' -- $i=0A= + ;;=0A= + esac=0A= + done=0A= fi=0A= ------=_NextPart_000_000E_01BE6705.8F107370--