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

PATCH: _dput tweak



We don't need to use grep and sed.

Index: Completion/Debian/Command/_dput
===================================================================
RCS file: /cvsroot/zsh/zsh/Completion/Debian/Command/_dput,v
retrieving revision 1.1
diff -u -r1.1 _dput
--- Completion/Debian/Command/_dput	2001/11/15 19:37:59	1.1
+++ Completion/Debian/Command/_dput	2001/11/18 20:20:55
@@ -1,9 +1,7 @@
 #compdef dput
 
 if (( ! $+_dput_sites )); then
-  _dput_sites=(
-$(grep "^\[" /etc/dput.cf | sed -e 's,\[,,g' -e 's,\],,g')
-)
+  _dput_sites=( ${${(M)${(f)"$(</etc/dput.cf)"}:#\[*}//[][]/} )
 fi
 
 _arguments '(-c)--config[config file]:config file:' \



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