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

Re: PATCH: completion for SysV initscripts



> 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