Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: lftp completion
- X-seq: zsh-workers 13613
- From: "Bart Schaefer" <schaefer@xxxxxxxxxxxxxxxxxxxxxxx>
- To: zsh-workers@xxxxxxxxxx
- Subject: Re: lftp completion
- Date: Tue, 13 Mar 2001 05:24:04 +0000
- In-reply-to: <m3vgpfg6gn.fsf@xxxxxxxxxxxxxxxxxxxxxxx>
- Mailing-list: contact zsh-workers-help@xxxxxxxxxx; run by ezmlm
- References: <3AABF298.8E4C5CD5@xxxxxxxxxxxxx> <m3vgpfg6gn.fsf@xxxxxxxxxxxxxxxxxxxxxxx>
Chmouel's _lftp function is very similar to _ncftp. Here's a single
function that handles both, without resorting to "awk -F" or "cut":
---- 8< ---- snip ---- 8< ----
#compdef ncftp lftp
local bookmarks=$HOME/.${words[0]:t}/bookmarks
if [[ -f $bookmarks ]]; then
bookmarks=(${"${(f)$(<$bookmarks)}"%%[[:space:],]*})
[[ ${words[0]:t} == ncftp ]] && shift 2 bookmarks
_wanted bookmarks expl bookmark compadd -a bookmarks && return 0
fi
_hosts
---- 8< ---- snip ---- 8< ----
Any object to replacing _ncftp with the above and removing _lftp? (One
possible objection might be that lftp allows commas in its bookmark
names; I don't know whether or not that's the case.)
--
Bart Schaefer Brass Lantern Enterprises
http://www.well.com/user/barts http://www.brasslantern.com
Zsh: http://www.zsh.org | PHPerl Project: http://phperl.sourceforge.net
Messages sorted by:
Reverse Date,
Date,
Thread,
Author