about summary refs log tree commit diff
diff options
context:
space:
mode:
authorClint Adams <clint@users.sourceforge.net>2001-03-18 14:19:02 +0000
committerClint Adams <clint@users.sourceforge.net>2001-03-18 14:19:02 +0000
commit638454bb0fa68fe567e66686f017d879fed5dd27 (patch)
treee69e0b5741e4de2e0aacc70376bff35478af1fae
parent7cfaf656c4035d514101bdd6aba79e2772e9d288 (diff)
downloadzsh-638454bb0fa68fe567e66686f017d879fed5dd27.tar.gz
zsh-638454bb0fa68fe567e66686f017d879fed5dd27.tar.xz
zsh-638454bb0fa68fe567e66686f017d879fed5dd27.zip
13661: complete args for SysV initscripts
-rw-r--r--ChangeLog6
-rw-r--r--Completion/SysV/.distfiles4
-rw-r--r--Completion/SysV/_sysv_initscripts17
3 files changed, 27 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index 7c1a2211a..c2fb753b0 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2001-03-18  Clint Adams  <schizo@debian.org>
+
+	* 13661: Completion/SysV/.distfiles,
+	Completion/SysV/_sysv_initscripts: complete arguments
+	for SysV initscripts.
+
 2001-03-17  Bart Schaefer  <schaefer@zsh.org>
 
 	* unposted (but see 13646 and users/3563): Doc/Zsh/contrib.yo,
diff --git a/Completion/SysV/.distfiles b/Completion/SysV/.distfiles
new file mode 100644
index 000000000..7864466f0
--- /dev/null
+++ b/Completion/SysV/.distfiles
@@ -0,0 +1,4 @@
+DISTFILES_SRC='
+    .distfiles
+    _sysv_initscripts
+'
diff --git a/Completion/SysV/_sysv_initscripts b/Completion/SysV/_sysv_initscripts
new file mode 100644
index 000000000..2f0a520f9
--- /dev/null
+++ b/Completion/SysV/_sysv_initscripts
@@ -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