Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: PATCH: zsh-3.1.5-pws-10: _configure completion



On Fri, 5 Mar 1999, Sven Wischnowsky wrote:

> 
> Ugh. Couldn't we try to avoid using MIME for patches, please? Using my 
> self-written Emacs-based mail reader I never had problems with this
> list and I really don't feel like starting up netscape or some such
> horror just to get at a patch.
>

And I, using Outlook (not willingly) have to make sure, that patch is not
mangled. Sigh ... Sven, really, MIME-disabled mailer now a days ...

Sent with Pine

/andrej


--- Completion/User/_configure	Thu Mar  4 19:27:03 1999
+++ /home/bor/.zsh.d/Completion/User/_configure	Fri Mar  5 12:27:58 1999
@@ -1,5 +1,7 @@
 #defcomp configure
 
+setopt localoptions extendedglob
+
 if [[ $PREFIX = *=* ]]; then
   # Complete filenames after e.g. --prefix=
   IPREFIX=${PREFIX%%=*}=
@@ -7,6 +9,27 @@
   compgen -f
 else
   # Generate a list of options from configure --help
-  compgen -s '$($words[1] --help |
-  sed -n -e '\''s/^ *\(--[-a-z0-9]*\)[    =,].*$/\1/p'\'')'
+  local -a pars
+  local i
+  pars=($($words[1] --help | awk '$1 ~ /--[a-z]*.*/ {print $1}'))
+  for i in $pars
+  do
+    case $i in
+      (--(((en|dis)able-FEATURE)|(with(out|)-PACKAGE))*)
+        : Skip standard help output
+      ;;
+      --enable)
+        : Skip standard help output
+      ;;
+      --*\[=* )
+        compadd -M 'r:|-=* r:|=*' -q -S = -- ${i%%\[=*}
+      ;;
+      --*=* )
+        compadd -M 'r:|-=* r:|=*' -S = -- ${i%%=*}
+      ;;
+      * )
+        compadd -M 'r:|-=* r:|=*' -- $i
+      ;;
+    esac
+  done
 fi



Messages sorted by: Reverse Date, Date, Thread, Author