Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: PATCH: update-alternatives completion
- X-seq: zsh-workers 14521
- From: Sven Wischnowsky <wischnow@xxxxxxxxxxxxxxxxxxxxxxx>
- To: zsh-workers@xxxxxxxxxx
- Subject: Re: PATCH: update-alternatives completion
- Date: Tue, 29 May 2001 09:25:01 +0200 (MET DST)
- In-reply-to: <20010528150509.A19581@xxxxxxxx>
- Mailing-list: contact zsh-workers-help@xxxxxxxxxx; run by ezmlm
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@xxxxxxxxxxxxxxxxxxxxxxx
Messages sorted by:
Reverse Date,
Date,
Thread,
Author