Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Count of last matches (was: RE: Reading completion manual)
- X-seq: zsh-workers 5617
- From: "Andrej Borsenkow" <borsenkow.msk@xxxxxx>
- To: "ZSH workers mailing list" <zsh-workers@xxxxxxxxxxxxxx>
- Subject: Count of last matches (was: RE: Reading completion manual)
- Date: Wed, 3 Mar 1999 12:05:22 +0300
- Importance: Normal
- Mailing-list: contact zsh-workers-help@xxxxxxxxxxxxxx; run by ezmlm
>
>
> Applied to all three: what about some return code to indicate, if
> some matches were added? Currently one has to save, and then
> compare, compstate[nmatches], that looks somewhat ugly. Using
> return code would provide for
>
> compgen -k friends || compgen -u
>
> Looks better for me. Probably, this idea could be used for all
> helper functions as well - is it useful?
>
What about following: add new item to compstate, say, last_nmatches, that
hold count of matches added by the *last* used compgen, compadd, compcall.
That can be used to test if we got something, and probably may be useful for
other tasks as well. And definitely better
if [[ $compstate[last_nmatches] -gt 0 ]]
than current
save nmatches
call completion
compare
cheers
/andrej
Messages sorted by:
Reverse Date,
Date,
Thread,
Author