From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27661 invoked from network); 13 Mar 2001 05:25:45 -0000 Received: from sunsite.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 13 Mar 2001 05:25:45 -0000 Received: (qmail 9060 invoked by alias); 13 Mar 2001 05:25:39 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 13613 Received: (qmail 9049 invoked from network); 13 Mar 2001 05:25:38 -0000 From: "Bart Schaefer" Message-Id: <1010313052404.ZM31652@candle.brasslantern.com> Date: Tue, 13 Mar 2001 05:24:04 +0000 In-Reply-To: Comments: In reply to Chmouel Boudjnah "lftp completion" (Mar 12, 1:46am) References: <3AABF298.8E4C5CD5@u.genie.co.uk> X-Mailer: Z-Mail (5.0.0 30July97) To: zsh-workers@sunsite.dk Subject: Re: lftp completion MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii 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