about summary refs log tree commit diff
path: root/Completion/User/_ncftp
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 /Completion/User/_ncftp
parentc925a15aa7e0e181e997df078ce06c9b3ce29857 (diff)
downloadzsh-467ad8e65bb486cdae8b3332439a4d1a36addb77.tar.gz
zsh-467ad8e65bb486cdae8b3332439a4d1a36addb77.tar.xz
zsh-467ad8e65bb486cdae8b3332439a4d1a36addb77.zip
Unify completion for ncftp and lftp in _ncftp
Diffstat (limited to 'Completion/User/_ncftp')
-rw-r--r--Completion/User/_ncftp11
1 files changed, 7 insertions, 4 deletions
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