From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21186 invoked from network); 4 Mar 1999 09:34:54 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 4 Mar 1999 09:34:54 -0000 Received: (qmail 12757 invoked by alias); 4 Mar 1999 09:34:37 -0000 Mailing-List: contact zsh-workers-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 5635 Received: (qmail 12750 invoked from network); 4 Mar 1999 09:34:36 -0000 Date: Thu, 4 Mar 1999 10:33:53 +0100 (MET) Message-Id: <199903040933.KAA02235@beta.informatik.hu-berlin.de> From: Sven Wischnowsky To: zsh-workers@sunsite.auc.dk In-reply-to: Sven Wischnowsky's message of Thu, 4 Mar 1999 10:21:15 +0100 (MET) Subject: Re: PATCH: return value for comp{add,gen} ( I just accidentally typed C-c C-c too early... ) I wrote: > The patch below makes `compadd' and `compgen' return zero if matches > were added and non-zero otherwise. With that Andrej's proposed > > compgen -g '*.c' || compgen -f > > works. I have not changed the return value since I think the `compctl was found' is the most important think to know about when using it. And since this will be called in a rather top-levellish way in most cases, the simple test `(( compstate[nmatches] ))' should be enough. Also, I'm not too sure about the `compstate[last_nmatches]' Andrej suggested. The exact number is seldom of interest and if it is, the shell code is simple enough, I think. As for the convention of using `matches were added' as the condition to set the return values of the example functions: yes, I like this. After a somwhat cursory glance at some of the function I even think that this wouldn't required too many changes (since most functions call `comp{add,gen}' or helper functions like `_files' at the end). Bye Sven -- Sven Wischnowsky wischnow@informatik.hu-berlin.de