From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16541 invoked from network); 29 May 2001 07:26:03 -0000 Received: from sunsite.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 29 May 2001 07:26:03 -0000 Received: (qmail 11649 invoked by alias); 29 May 2001 07:25:57 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 14521 Received: (qmail 11636 invoked from network); 29 May 2001 07:25:56 -0000 From: Sven Wischnowsky Date: Tue, 29 May 2001 09:25:01 +0200 (MET DST) Message-Id: <200105290725.JAA08735@beta.informatik.hu-berlin.de> To: zsh-workers@sunsite.dk Subject: Re: PATCH: update-alternatives completion In-Reply-To: <20010528150509.A19581@dman.com> Clint Adams wrote: > The problem I alluded to in 14512 is present here. If one > tries to complete update-alternatives --remove, > it tries to complete an "alt" argument in between > --remove and the 1st argument. Since the state is specified > rather than possible completions for that argument, it > doesn't seem very useful. Here's the code: > + '--install:*::alt:->install' \ > + '--remove:*::alt:->remove' \ The `:*::' removes everything up to the first argument after --remove and --install. Everything. In particular: there's no `command word' anymore and quite some time ago we decided that _arguments has to be careful to complete only real arguments -- hence you don't get completion for the first argument after these options. Once there is an argument, the calls to _arguments in the state-handling code are happy to serve you because now they think that that first argument to the option is the command word. To solve this, we invented the `= ' prefix for _argument actions, i.e.: just change the above to `...:= ->install' and so on. > > Also, the slave substate doesn't work, but I haven't > bothered to look into it yet. By this description I don't know what you mean -- and without anything debianish here I can't really try. But anyway, you'd need some kind of loop around the `case...esac' to enable these: > + '--slave:*::slave:->islave' \ But of course you know that... > ... > > + '1:altname:_files -W /var/lib/dpkg/alternatives' \ Isn't there a better description than `altname'? Or is this some well known, recognised word in the debian world? Bye Sven P.S.: Too late now, but do you really like these mixed underscore/hyphen names? P.P.S.: A command name with 19 characters? What are we coming to... ;-) -- Sven Wischnowsky wischnow@informatik.hu-berlin.de