Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Completion alias
- X-seq: zsh-workers 23231
- From: Peter Stephenson <pws@xxxxxxx>
- To: zsh-workers@xxxxxxxxxx
- Subject: Re: Completion alias
- Date: Fri, 23 Mar 2007 12:29:59 +0000
- In-reply-to: <slrnf07brn.ist.joerg@xxxxxxxxxxxx>
- Mailing-list: contact zsh-workers-help@xxxxxxxxxx; run by ezmlm
- References: <joerg@xxxxxxxxxxxx> <200703230001.l2N013h0009082@xxxxxxxxxxxxxxxxx> <slrnf07brn.ist.joerg@xxxxxxxxxxxx>
=?UTF-8?Q?J=C3=B6rg?= Sommer wrote:
> But how can I use this for a completion of a command with an argument,
> i.e. agi should have the same completion as 'agt-get install'
That would require some rewriting of _apt. It's easy to specify
that a function should behave like apt-get:
compdef agi=apt-get
but without support in _apt there's no way of telling it to behave
as if the "install" argument is present.
I came up with a way of doing this for the Perforce completion:
compdef _perforce p4cvsmap=p4-files
says that "p4cvsmap ..." behaves like "p4 files ...". However, it's
not trivial to bolt this method onto an existing completion unless
it already has separate despatchers for subcommands. Furthermore,
_apt uses the regex handling which makes it even more difficult.
--
Peter Stephenson <pws@xxxxxxx> Software Engineer
CSR PLC, Churchill House, Cambridge Business Park, Cowley Road
Cambridge, CB4 0WZ, UK Tel: +44 (0)1223 692070
To access the latest news from CSR copy this link into a web browser: http://www.csr.com/email_sig.php
To get further information regarding CSR, please visit our Investor Relations page at http://ir.csr.com/csr/about/overview
Messages sorted by:
Reverse Date,
Date,
Thread,
Author