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

Re: Completion alias



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