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

Re: Using the same completion function for various commands



On Tue, 07 Dec 2010 15:51:54 +0100
Oliver Kiddle <okiddle@xxxxxxxxxxx> wrote:
> Peter Stephenson wrote:
> > It looks like you can't in general distinguish between two ways of
> > using the service:
> 
> I don't think $service was ever intended to be usable as a command
> name. The change also now assumes that the command is in your path
> which often it isn't. It's also common to use /usr/gnu/bin/du and
> expect it to use the GNU completions. Someone writing obscure
> wrappers can sooner be expected to know what they're doing that
> someone specifying commands with a full path.
> 
> > In the first case you have the simple alternative of defining
> > 
> > #compdef gdu
> > _du "$@"
> >
> > which fixes the service for you.
> 
> And in the second case you have the simple alternative of using
> zstyle. I've got tens of these and am not too keen on creating
> functions. And why break backward compatibility?

OK, if you've got stuff that actually breaks that's a good reason for
leaving it & I'll put it back the other way.

-- 
Peter Stephenson <pws@xxxxxxx>            Software Engineer
Tel: +44 (0)1223 692070                   Cambridge Silicon Radio Limited
Churchill House, Cambridge Business Park, Cowley Road, Cambridge, CB4 0WZ, UK


Member of the CSR plc group of companies. CSR plc registered in England and Wales, registered number 4187346, registered office Churchill House, Cambridge Business Park, Cowley Road, Cambridge, CB4 0WZ, United Kingdom



Messages sorted by: Reverse Date, Date, Thread, Author