Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: completion test suggestion
- X-seq: zsh-workers 5522
- From: Sven Wischnowsky <wischnow@xxxxxxxxxxxxxxxxxxxxxxx>
- To: zsh-workers@xxxxxxxxxxxxxx
- Subject: Re: completion test suggestion
- Date: Thu, 25 Feb 1999 11:28:51 +0100 (MET)
- In-reply-to: Sven Wischnowsky's message of Wed, 24 Feb 1999 10:29:36 +0100 (MET)
- Mailing-list: contact zsh-workers-help@xxxxxxxxxxxxxx; run by ezmlm
I wrote:
> To make this more friendly to the eye, we could also keep the
> condition codes and make them non-modifying:
>
> if [[ -between s1 s2 ]]; then
> words=("${(@)words[rangebeg(s1,s2),rangeend(s1,s2)]}")
>
> and so on.
After thinking more about this: for this example the test
`(( -rangebeg(s1,s2) ))' should already be enough. For other tests we
could just add some helpful functions, e.g. `prefix(s1,s2)' which
returns the length of the common prefix of both strings and so
on. Such functions may be helpful in writing shell functions that do
matching anyway and with a good set of such functions we could put all
tests together in one `(( ... ))'.
Bye
Sven
--
Sven Wischnowsky wischnow@xxxxxxxxxxxxxxxxxxxxxxx
Messages sorted by:
Reverse Date,
Date,
Thread,
Author