zsh-workers
 help / color / mirror / code / Atom feed
From: Peter Stephenson <pws@csr.com>
To: zsh-workers@sunsite.dk
Subject: Re: Completion alias
Date: Fri, 23 Mar 2007 12:29:59 +0000	[thread overview]
Message-ID: <200703231230.l2NCU0MS030229@news01.csr.com> (raw)
In-Reply-To: <slrnf07brn.ist.joerg@alea.gnuu.de>

=?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@csr.com>                  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


  reply	other threads:[~2007-03-23 12:30 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <joerg@alea.gnuu.de>
2007-03-22 22:51 ` Jörg Sommer
2007-03-23  0:01   ` Peter Stephenson
2007-03-23 10:44     ` Jörg Sommer
2007-03-23 12:29       ` Peter Stephenson [this message]
2007-03-23 15:54         ` Bart Schaefer
2007-03-30 11:14           ` Jörg Sommer
2007-03-30 16:03             ` Bart Schaefer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200703231230.l2NCU0MS030229@news01.csr.com \
    --to=pws@csr.com \
    --cc=zsh-workers@sunsite.dk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).