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

Re: Count of last matches (was: RE: Reading completion manual)



Andrej Borsenkow writes:
 > 
 > > 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
 > 
 > 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 might be useful, but I think the most useful bit of information is
whether anything at all was added (or whether the calling function
should behave as if anything at all was added, which may be a different
thing).

So even if a last_nmatches key were added to compstate, I'd still be in
favor of a useful return value from compgen et al.



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