From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18955 invoked from network); 29 May 2001 13:09:33 -0000 Received: from sunsite.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 29 May 2001 13:09:33 -0000 Received: (qmail 13090 invoked by alias); 29 May 2001 13:09:16 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 14535 Received: (qmail 13064 invoked from network); 29 May 2001 13:09:14 -0000 From: Sven Wischnowsky Date: Tue, 29 May 2001 15:08:18 +0200 (MET DST) Message-Id: <200105291308.PAA09291@beta.informatik.hu-berlin.de> To: zsh-workers@sunsite.dk Subject: Re: PATCH: Re: PATCH: update-alternatives completion In-Reply-To: <20010529083212.A31244@dman.com> Clint Adams wrote: > ... > > update-alternatives --quiet --install /usr/bin/awk awk /usr/bin/gawk 10 \ > --slave /usr/share/man/man1/awk.1.gz awk.1.gz /usr/share/man/man1/gawk.1.gz \ > --slave /usr/bin/nawk nawk /usr/bin/gawk \ > --slave /usr/share/man/man1/nawk.1.gz nawk.1.gz /usr/share/man/man1/gawk.1.gz > > For each --slave, you repeat the . Two possibilities, then (at least). The large one (simplified): while true; do case "$state" in islave) state= _arguments '1:path:(spath)' \ '2:name:(sname)' \ '3:path:(spath2)' \ '--slave:*::more:= ->islave' && return 0 [[ -z $state ]] && return 1 ;; install) _arguments '1:link:(link)' \ '2:name:(name)' \ '3:path:(path)' \ '--slave:*::more:= ->islave' && return 0 [[ -z $state ]] && return 1 ;; other states) ... ;; esac done Or just (simplified, too): case "$state" in other states) ... ;; install) _arguments '1:link:(link)' \ '2:name:(name)' \ '3:path:(path)' \ '*--slave:path:(spath):name:(sname):path:(spath2)' esac Without a `islave' state. It would allow mixing the arguments of --install with the --slave options which probably isn't allowed. Bye Sven -- Sven Wischnowsky wischnow@informatik.hu-berlin.de