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

Re: read timeout argument || completion of a function

On Mon, Aug 12, 2002 at 12:43:08PM +0200, Bruno Bonfils wrote:
> > On Aug 11, 10:54pm, Bruno Bonfils wrote:
> > } 
> > } i'm very surprised to observe there isn't timeout argument for
> > } read builtin function.
> >
> > There are certain aspects of the arms race in which ksh is currently
> > ahead.  I suppose when it gets a builtin to launch satellites we'll
> > have to start working on moon landers.
> >
> I'm don't sure to understanding you at all. (maybe my sentence is
> meaningless ?) 

Your sentence is fine. There are just a few features in ksh that are
lacking in zsh and the timeout to read is one of them.
> So, do you think it's difficult to add this argument to read builtin
> function ? 

That is probably for Peter to say. It has been mentioned before and I'd
guess it is doable because zselect does roughly the same. It would
also need some nasty special casing for the argument parsing if we
maintain compatibility with both older zsh and ksh so that may have been
a factor in it not being implemented as yet. In the meantime, Bart's
suggestion of using zselect should provide what you need.

> > completion function.  The default completion is what is called when
> > there isn't any other completion defined, and it is implemented by a
> > function that is named _default, which happens to call another
> > function named _files.
> hmm ok, i understand now. So, in this case, it's possible to change
> the function which called by _default for only one command using
> zstyle ?

Not with zstyle. You use compdef to define which function is called.

> sure, in fact i have :
> % vi .zsh/functions/_upgrade
> #compdef upgrade
> _arguments '*:hostname:_hosts'
> % zcompile _upgrade

You could do that all more easily by just adding the line:

compdef _hosts upgrade

to your .zshrc.


This e-mail and any attachment is for authorised use by the intended recipient(s) only.  It may contain proprietary material, confidential information and/or be subject to legal privilege.  It should not be copied, disclosed to, retained or used by, any other party.  If you are not an intended recipient then please promptly delete this e-mail and any attachment and all copies and inform the sender.  Thank you.

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