Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: PATCH: completion for SysV initscripts
- X-seq: zsh-workers 13664
- From: Clint Adams <schizo@xxxxxxxxxx>
- To: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxxxxxxxxx>
- Subject: Re: PATCH: completion for SysV initscripts
- Date: Sun, 18 Mar 2001 14:49:00 -0500
- Cc: zsh-workers@xxxxxxxxxx
- In-reply-to: <1010318175713.ZM12585@xxxxxxxxxxxxxxxxxxxxxxx>; from schaefer@xxxxxxxxxxxxxxxxxxxxxxx on Sun, Mar 18, 2001 at 05:57:13PM +0000
- Mailing-list: contact zsh-workers-help@xxxxxxxxxx; run by ezmlm
- References: <20010318091523.A6942@xxxxxxxx> <1010318175713.ZM12585@xxxxxxxxxxxxxxxxxxxxxxx>
> 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 <space>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_]} )
Messages sorted by:
Reverse Date,
Date,
Thread,
Author