From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9736 invoked from network); 18 Mar 2001 19:49:16 -0000 Received: from sunsite.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 18 Mar 2001 19:49:16 -0000 Received: (qmail 7585 invoked by alias); 18 Mar 2001 19:49:07 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 13664 Received: (qmail 7573 invoked from network); 18 Mar 2001 19:49:06 -0000 Date: Sun, 18 Mar 2001 14:49:00 -0500 From: Clint Adams To: Bart Schaefer Cc: zsh-workers@sunsite.dk Subject: Re: PATCH: completion for SysV initscripts Message-ID: <20010318144900.A22577@dman.com> References: <20010318091523.A6942@dman.com> <1010318175713.ZM12585@candle.brasslantern.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <1010318175713.ZM12585@candle.brasslantern.com>; from schaefer@candle.brasslantern.com on Sun, Mar 18, 2001 at 05:57:13PM +0000 > Isn't this going to conflict with Completion/User/_init_d ? Does _init_d > not work on Debian? Ugh. I appear to have completely missed that thread. I'll remove the new stuff. This incorporates rcS.d, and force-re{load,start} possibilities. Debian policy mandates `start', `stop', `restart', and `force-reload'. `reload' is optional, and, of course, you'll find other arguments in various scripts. I guess the easiest thing would be to have a style setting for when the file can't be parsed (defaulting to start,stop). Index: Completion/User/_init_d =================================================================== RCS file: /cvsroot/zsh/zsh/Completion/User/_init_d,v retrieving revision 1.2 diff -u -r1.2 _init_d --- Completion/User/_init_d 2001/03/08 10:17:04 1.2 +++ Completion/User/_init_d 2001/03/18 19:37:40 @@ -1,4 +1,4 @@ -#compdef -P */(init|rc[0-9]#).d/* +#compdef -P */(init|rc[0-9S]#).d/* local magic cmds what @@ -7,7 +7,7 @@ # If the file starts with `#!' we hope that this is a shell script # and get lines looking like foo|bar) with the words in $what. -what='(st(art|op|atus)|re(start|load)|debug_(up|down)|dump(|_stats)|add|delete|clean|list)' +what='(st(art|op|atus)|(force-|)re(start|load)|debug_(up|down)|dump(|_stats)|add|delete|clean|list)' read -u0k 2 magic < $words[1] && [[ $magic = '#!' ]] && cmds=( ${${(j:|:s:|:)${(M)${(f)"$(< $words[1])"}:#[[:blank:]]#(\'|)${~what}(|${~what})#(\'|)\)}}//[^a-z_]} )