Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Completion alias
- X-seq: zsh-workers 23249
- From: Jörg Sommer <joerg@xxxxxxxxxxxx>
- To: zsh-workers@xxxxxxxxxx
- Subject: Re: Completion alias
- Date: Fri, 30 Mar 2007 11:14:17 +0000 (UTC)
- Mailing-list: contact zsh-workers-help@xxxxxxxxxx; run by ezmlm
- References: <joerg@xxxxxxxxxxxx> <200703230001.l2N013h0009082@xxxxxxxxxxxxxxxxx> <slrnf07brn.ist.joerg@xxxxxxxxxxxx> <200703231230.l2NCU0MS030229@xxxxxxxxxxxxxx> <070323085458.ZM13978@xxxxxxxxxxxxxxxxxxxxxx>
- Sender: news <news@xxxxxxxxxxxx>
Hello Bart,
Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> wrote:
> On Mar 23, 12:29pm, Peter Stephenson wrote:
> } Subject: Re: Completion alias
> }
> } =?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.
>
> I think it should also work to do
>
> _agi () {
> shift words
> service=apt-get
> words=(apt-get install $words)
> ((CURRENT++))
> _apt
Why you don't call _apt-get directly?
> }
> compdef _agi agi
>
> However, there may be something else that needs to be twaddled as well
> as service= and words= to guarantee that this works properly.
Yes, you are right. The completion of long and short options (--help
and -h) doesn't work. But it works for the packages and this is a big
help for the first time.
Bye, Jörg.
--
Es ist außerdem ein weit verbreiteter Irrtum das USENET ‚helfen‘ soll.
Tatsächlich wurde USENET nachweislich zur persönlichen Belustigung
seiner Erfinder geschaffen.
Jörg Klemenz <joerg@xxxxxxx>, <b4ai4o$1u8vmt$2@xxxxxxxxxxxxxxxxxxxxxxx>
Messages sorted by:
Reverse Date,
Date,
Thread,
Author