Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: PATCH: update-alternatives completion



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