diff options
author | Bart Schaefer <barts@users.sourceforge.net> | 2001-03-13 18:13:17 +0000 |
---|---|---|
committer | Bart Schaefer <barts@users.sourceforge.net> | 2001-03-13 18:13:17 +0000 |
commit | 467ad8e65bb486cdae8b3332439a4d1a36addb77 (patch) | |
tree | 1f0cc0124ef2ef28f4edacac72f1209cc51dfb39 /Completion/User/_ncftp | |
parent | c925a15aa7e0e181e997df078ce06c9b3ce29857 (diff) | |
download | zsh-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/_ncftp | 11 |
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 |