zsh-workers
 help / color / mirror / code / Atom feed
* PATCH: completion for SysV initscripts
@ 2001-03-18 14:15 Clint Adams
  2001-03-18 17:57 ` Bart Schaefer
  0 siblings, 1 reply; 3+ messages in thread
From: Clint Adams @ 2001-03-18 14:15 UTC (permalink / raw)
  To: zsh-workers

This is perhaps a bit too Debian-centric, but should be okay
on any OS if the script uses a case statement.

Index: Completion/SysV/.distfiles
===================================================================
RCS file: .distfiles
diff -N .distfiles
--- /dev/null	Mon Dec 11 17:26:27 2000
+++ .distfiles	Sun Mar 18 06:08:22 2001
@@ -0,0 +1,4 @@
+DISTFILES_SRC='
+    .distfiles
+    _sysv_initscripts
+'
Index: Completion/SysV/_sysv_initscripts
===================================================================
RCS file: _sysv_initscripts
diff -N _sysv_initscripts
--- /dev/null	Mon Dec 11 17:26:27 2000
+++ _sysv_initscripts	Sun Mar 18 06:08:22 2001
@@ -0,0 +1,17 @@
+#compdef -p /etc/(init|rc[0-9S]).d/*
+
+local stdargs nonstdargs expl
+
+if [[ -f $words[1] ]]
+then
+nonstdargs=(${${(s: :)${${${${(M)${(f)"$(<$words[1])"}:#[	 a-z-|]##\)*}%\)*}##\ #}:gs/|/ /}:s/	//}:#(start|stop|restart|force-reload|reload)})
+stdargs=(${(M)${(s: :)${${${${(M)${(f)"$(<$words[1])"}:#[	 a-z-|]##\)*}%\)*}##\ #}:gs/|/ /}:s/	//}:#(start|stop|restart|force-reload|reload)})
+else
+nonstdargs=()
+stdargs=(start stop restart force-reload)
+fi
+
+_tags nonstdargs stdargs
+
+_wanted -V stdargs expl "standard arguments" compadd -a stdargs
+_wanted nonstdargs expl "non-standard arguments" compadd -a nonstdargs


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2001-03-18 19:49 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-03-18 14:15 PATCH: completion for SysV initscripts Clint Adams
2001-03-18 17:57 ` Bart Schaefer
2001-03-18 19:49   ` Clint Adams

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).