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

PATCH: compinit and _zftp



compdef -k and -p weren't working in autoloaded functions, and I spotted a
mistake in the first argument of zftp.

pws-15 should appear real soon now.  I haven't included the optimisation of
${..#..} and ${..%..} yet, do people think this is slow enough to need the
special cases?

--- Completion/Builtins/_zftp.old	Tue Apr 13 09:37:39 1999
+++ Completion/Builtins/_zftp	Tue Apr 13 13:42:06 1999
@@ -10,7 +10,7 @@
 local subcom
 
 if [[ $words[1] = zftp ]]; then
-  if [[ $CURRENT -eq 1 ]]; then
+  if [[ $CURRENT -eq 2 ]]; then
     compadd open params user login type ascii binary mode put \
       putat get getat append appendat ls dir local remote mkdir rmdir
     return
--- Completion/Core/compinit.old	Tue Apr 13 10:32:16 1999
+++ Completion/Core/compinit	Tue Apr 13 13:38:39 1999
@@ -273,11 +273,11 @@
       _i_tag=$_i_line[1]
       shift _i_line
       if [[ $_i_tag = '#compdef' ]]; then
-        case $_i_line[2] in
-	-p) compdef -pa "${_i_file:t}" "${_i_line[@]}";;
-	-k) compdef -ka "${_i_file:t}" "${_i_line[@]}";;
-	*)  compdef -na "${_i_file:t}" "${_i_line[@]}";;
-	esac
+	if [[ $_i_line[1] = -[pk] ]]; then
+	  compdef ${_i_line[1]}a "${_i_file:t}" "${(@)_i_line[2,-1]}"
+	else
+	  compdef -na "${_i_file:t}" "${_i_line[@]}"
+	fi
       elif [[ $_i_tag = '#autoload' ]]; then
 	autoload ${_i_file:t}
       fi

-- 
Peter Stephenson <pws@xxxxxxxxxxxxxxxxx>       Tel: +39 050 844536
WWW:  http://www.ifh.de/~pws/
Dipartimento di Fisica, Via Buonarroti 2, 56127 Pisa, Italy



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