From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9301 invoked from network); 28 Jun 2005 13:46:02 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 28 Jun 2005 13:46:02 -0000 Received: (qmail 64519 invoked from network); 28 Jun 2005 13:45:56 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 28 Jun 2005 13:45:56 -0000 Received: (qmail 3070 invoked by alias); 28 Jun 2005 13:45:54 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 21393 Received: (qmail 3059 invoked from network); 28 Jun 2005 13:45:53 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by sunsite.dk with SMTP; 28 Jun 2005 13:45:53 -0000 Received: (qmail 64170 invoked from network); 28 Jun 2005 13:45:53 -0000 Received: from cluster-e.mailcontrol.com (HELO rly16e.srv.mailcontrol.com) (217.79.216.190) by a.mx.sunsite.dk with SMTP; 28 Jun 2005 13:45:46 -0000 Received: from iris.logica.co.uk (iris.logica.co.uk [158.234.9.163]) by rly16e.srv.mailcontrol.com (MailControl) with ESMTP id j5SDjg7f002338 for ; Tue, 28 Jun 2005 14:45:42 +0100 Received: from trentino.logica.co.uk ([158.234.142.59]) by iris.logica.co.uk (8.12.3/8.12.3/Debian -4) with ESMTP id j5SDjfKM026360 for ; Tue, 28 Jun 2005 14:45:41 +0100 Received: from trentino.groupinfra.com (localhost [127.0.0.1]) by trentino.logica.co.uk (Postfix) with ESMTP id 45D207722C for ; Tue, 28 Jun 2005 15:45:41 +0200 (CEST) X-VirusChecked: Checked X-StarScan-Version: 5.0.7; banners=.,-,- In-reply-to: <20050624184620.GA19301@scowler.net> From: Oliver Kiddle References: <20050624184620.GA19301@scowler.net> To: zsh-workers@sunsite.dk Subject: Re: PATCH: _kvno Date: Tue, 28 Jun 2005 15:45:41 +0200 Message-ID: <9960.1119966341@trentino.groupinfra.com> X-Scanned-By: MailControl A-05-01-01 (www.mailcontrol.com) X-Spam-Checker-Version: SpamAssassin 3.0.2 on a.mx.sunsite.dk X-Spam-Level: X-Spam-Status: No, score=-2.5 required=6.0 tests=AWL,BAYES_00 autolearn=ham version=3.0.2 X-Spam-Hits: -2.5 On 24 Jun, Clint Adams wrote: > This is for MIT krb5, and is ignorant of Kerberos realms, other service > types, and pretty much everything else, but all I care about is the host > completion. Don't forget that you need to declare various stuff local if you're going to use states. And pass -C to _arguments if you don't want to handle $context. It would also be nice if we can maintain consistency on things like indentation between the completion functions. Oliver Index: Completion/Unix/Command/_kvno =================================================================== RCS file: /cvsroot/zsh/zsh/Completion/Unix/Command/_kvno,v retrieving revision 1.1 diff -u -w -r1.1 _kvno --- Completion/Unix/Command/_kvno 24 Jun 2005 18:49:15 -0000 1.1 +++ Completion/Unix/Command/_kvno 28 Jun 2005 13:42:17 -0000 @@ -1,22 +1,24 @@ #compdef kvno -_arguments \ - '-c[credentials cache]:cache:_files' \ - '-e[enctype]:enctype:' \ +local curcontext="$curcontext" state line ret=1 + +_arguments -C \ + '(-4)-c[specify credentials cache to use]:cache:_files' \ + '(-4)-e[specify encryption type]:encryption type' \ '-q[suppress printing]' \ '-h[help]' \ - '-4[kerberos 4 tickets]' \ - ':principal:->principal' && return 0 + '(-c -e)-4[kerberos 4 tickets]' \ + ':principal:->principal' && ret=0 -case "$state" in - (principal) +if [[ $state = principal ]]; then if [[ -prefix host/ ]]; then compset -P host/ - _hosts + _hosts && ret=0 else _alternative \ 'users:user:_users' \ - 'services:service:compadd -S/ host' + 'services:service:compadd -S/ host' && ret=0 + fi fi - ;; -esac + +return ret This e-mail and any attachment is for authorised use by the intended recipient(s) only. It may contain proprietary material, confidential information and/or be subject to legal privilege. It should not be copied, disclosed to, retained or used by, any other party. If you are not an intended recipient then please promptly delete this e-mail and any attachment and all copies and inform the sender. Thank you.