From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13579 invoked from network); 29 Jun 2004 16:42:02 -0000 Received: from odin.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.85) by ns1.primenet.com.au with SMTP; 29 Jun 2004 16:42:02 -0000 Received: (qmail 9052 invoked from network); 29 Jun 2004 17:52:18 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 29 Jun 2004 17:52:18 -0000 Received: (qmail 4336 invoked by alias); 29 Jun 2004 16:41:13 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 7620 Received: (qmail 4319 invoked from network); 29 Jun 2004 16:41:13 -0000 Received: from odin.dotsrc.org (HELO a.mx.sunsite.dk) (qmailr@130.225.247.85) by sunsite.dk with SMTP; 29 Jun 2004 16:41:13 -0000 Received: (qmail 7351 invoked from network); 29 Jun 2004 17:51:44 -0000 Received: from unknown (HELO moonbase.zanshin.com) (@167.160.213.139) by a.mx.sunsite.dk with SMTP; 29 Jun 2004 17:51:30 -0000 Received: from toltec.zanshin.com (toltec.zanshin.com [64.84.47.166]) by moonbase.zanshin.com (8.12.11/8.12.11) with ESMTP id i5TGeg2r010176 for ; Tue, 29 Jun 2004 09:40:42 -0700 Date: Tue, 29 Jun 2004 09:40:42 -0700 (PDT) From: Bart Schaefer Reply-To: zsh-users@sunsite.dk To: zsh-users@sunsite.dk Subject: Re: users@hosts completion In-Reply-To: <20040627121512.GC22418@red-hots.cs.utk.edu> Message-ID: References: <20040627121512.GC22418@red-hots.cs.utk.edu> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Spam-Checker-Version: SpamAssassin 2.63 on a.mx.sunsite.dk X-Spam-Level: X-Spam-Status: No, hits=0.0 required=6.0 tests=none autolearn=no version=2.63 X-Spam-Hits: 0.0 On Sun, 27 Jun 2004, Chris Johnson wrote: > How can I setup users-hosts completion for my specified commands? Unfortunately you can't set this up with zstyles only, because it relies on a special utility function called _combination which has to be called in the correct way from the function that generates potential matches for the command in question. There's a generic function called _user_at_host that does this for the special case of "user@hostname" arguments, but you still need another function (which calls e.g. _arguments) to interpret the command line and call _user_at_host when the cursor is in the correct argument position. If it happens that your command has argument syntax very similar to one of the commands that already uses users-hosts completion, then you can tell the completion system to treat completion for your command exactly the same as completion for that other command. You do that with a "compdef" command like so: compdef mynewcommand=telnet Otherwise you'll have to delve into the writing of a new completion.