From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19477 invoked from network); 29 May 2001 14:19:51 -0000 Received: from sunsite.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 29 May 2001 14:19:51 -0000 Received: (qmail 11974 invoked by alias); 29 May 2001 14:19:38 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 14536 Received: (qmail 11951 invoked from network); 29 May 2001 14:19:37 -0000 Date: Tue, 29 May 2001 10:19:31 -0400 From: Clint Adams To: Sven Wischnowsky Cc: zsh-workers@sunsite.dk Subject: Re: PATCH: Re: PATCH: update-alternatives completion Message-ID: <20010529101931.A32458@dman.com> References: <20010529083212.A31244@dman.com> <200105291308.PAA09291@beta.informatik.hu-berlin.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <200105291308.PAA09291@beta.informatik.hu-berlin.de>; from wischnow@informatik.hu-berlin.de on Tue, May 29, 2001 at 03:08:18PM +0200 > Two possibilities, then (at least). The large one (simplified): Here goes. Index: Completion/Debian/Command/_update-alternatives =================================================================== RCS file: /cvsroot/zsh/zsh/Completion/Debian/Command/_update-alternatives,v retrieving revision 1.2 diff -u -r1.2 _update-alternatives --- Completion/Debian/Command/_update-alternatives 2001/05/29 12:39:31 1.2 +++ Completion/Debian/Command/_update-alternatives 2001/05/29 14:17:16 @@ -16,26 +16,39 @@ '--display:name:_files -W /var/lib/dpkg/alternatives' \ '--config:name:_files -W /var/lib/dpkg/alternatives' && return 0 -_call_function ret _update_alternatives_$state && return ret +while true; do case "$state" in islave) + _call_function ret _update_alternatives_$state && return ret + state= _arguments -C '1:link:_files' \ '2:name:_files -W /var/lib/dpkg/alternatives' \ '3:path:_files' \ - '--slave:*::slave:->islave' + '--slave:*::more:= ->islave' && return 0 + [[ -z $state ]] && return 1 ;; + install) + _call_function ret _update_alternatives_$state && return ret _arguments -C '1:link:_files' \ '2:name:_files -W /var/lib/dpkg/alternatives' \ '3:path:_files' \ '4:priority:' \ - '--slave:*::slave:->islave' \ + '--slave:*::slave:= ->islave' && return 0 + [[ -z $state ]] && return 1 ;; remove) + _call_function ret _update_alternatives_$state && return ret _arguments \ '1:name:_files -W /var/lib/dpkg/alternatives' \ - '2:path:_files' + '2:path:_files' && return 0 + return 1 + ;; + + *) + return 1 ;; esac +done