From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6930 invoked from network); 3 Mar 1999 09:06:26 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 3 Mar 1999 09:06:26 -0000 Received: (qmail 12778 invoked by alias); 3 Mar 1999 09:06:07 -0000 Mailing-List: contact zsh-workers-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 5617 Received: (qmail 12771 invoked from network); 3 Mar 1999 09:06:05 -0000 From: "Andrej Borsenkow" To: "ZSH workers mailing list" Subject: Count of last matches (was: RE: Reading completion manual) Date: Wed, 3 Mar 1999 12:05:22 +0300 Message-ID: <000a01be6554$f8102b20$21c9ca95@mowp.siemens.ru> MIME-Version: 1.0 Content-Type: text/plain; charset="Windows-1252" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2910.0) X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2013.2901 Importance: Normal > > > 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