about summary refs log tree commit diff
diff options
context:
space:
mode:
authorBart Schaefer <barts@users.sourceforge.net>2001-03-13 18:13:17 +0000
committerBart Schaefer <barts@users.sourceforge.net>2001-03-13 18:13:17 +0000
commit467ad8e65bb486cdae8b3332439a4d1a36addb77 (patch)
tree1f0cc0124ef2ef28f4edacac72f1209cc51dfb39
parentc925a15aa7e0e181e997df078ce06c9b3ce29857 (diff)
downloadzsh-467ad8e65bb486cdae8b3332439a4d1a36addb77.tar.gz
zsh-467ad8e65bb486cdae8b3332439a4d1a36addb77.tar.xz
zsh-467ad8e65bb486cdae8b3332439a4d1a36addb77.zip
Unify completion for ncftp and lftp in _ncftp
-rw-r--r--ChangeLog5
-rw-r--r--Completion/User/.distfiles2
-rw-r--r--Completion/User/_lftp5
-rw-r--r--Completion/User/_ncftp11
4 files changed, 13 insertions, 10 deletions
diff --git a/ChangeLog b/ChangeLog
index 2892a2307..077431d4e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2001-03-13  Bart Schaefer  <schaefer@zsh.org>
+
+	* 13613, 13620: Completion/User/_ncftp, Completion/User/_lftp:
+	Unify completion for ncftp and lftp in _ncftp (removed _lftp).
+
 2001-03-13  Peter Stephenson  <pws@csr.com>
 
 	* 13611, 13615: Doc/Zsh/zle.yo, Src/init.c, Src/zsh.h, 
diff --git a/Completion/User/.distfiles b/Completion/User/.distfiles
index 34ca2c391..4411fb28e 100644
--- a/Completion/User/.distfiles
+++ b/Completion/User/.distfiles
@@ -6,7 +6,7 @@ DISTFILES_SRC='
     _enscript _find _finger _fakeroot _fetchmail _flex
     _gcc _gdb  _getconf _gprof _grep _groups _gs _gv _gzip
     _hosts _imagemagick _iconv _init_d _ispell
-    _java _joe _killall _lftp _look _lp _ls _lynx _lzop
+    _java _joe _killall _look _lp _ls _lynx _lzop
     _mailboxes _make _man _mere _mh _mount _mutt _my_accounts _mysql_utils
     _ncftp _nedit _netscape _newsgroups _nslookup _other_accounts
     _pack _patch _pbm _pdf _perl _perl_basepods _perl_builtin_funcs
diff --git a/Completion/User/_lftp b/Completion/User/_lftp
deleted file mode 100644
index 610f6991a..000000000
--- a/Completion/User/_lftp
+++ /dev/null
@@ -1,5 +0,0 @@
-#compdef lftp
-if [[ -f ~/.lftp/bookmarks ]]; then
-  _wanted bookmarks expl bookmark \
-      compadd - $(cut -f1 ~/.lftp/bookmarks) && return 0
-fi
diff --git a/Completion/User/_ncftp b/Completion/User/_ncftp
index e760b3536..64f2aee31 100644
--- a/Completion/User/_ncftp
+++ b/Completion/User/_ncftp
@@ -1,8 +1,11 @@
-#compdef ncftp
+#compdef ncftp lftp
 
-if [[ -f ~/.ncftp/bookmarks ]]; then
-  _wanted bookmarks expl bookmark \
-      compadd - $(awk -F, 'NR > 2 { print $1 }' ~/.ncftp/bookmarks) && return 0
+local bookmarks=$HOME/.$service/bookmarks
+
+if [[ -f $bookmarks ]]; then
+  bookmarks=(${"${(f)$(<$bookmarks)}"%%[[:space:],]*})
+  [[ $service == ncftp ]] && shift 2 bookmarks  
+  _wanted bookmarks expl bookmark compadd -a bookmarks && return 0
 fi
 
 _hosts