summaryrefslogtreecommitdiff
path: root/etc/completions/_initd
diff options
context:
space:
mode:
authorDaniel Friesel <derf@derf.homelinux.org>2008-11-12 18:41:39 +0100
committerDaniel Friesel <derf@derf.homelinux.org>2008-11-12 18:41:39 +0100
commita8b27eff0b6a630f8c7c46582fd70c71784f6535 (patch)
tree672d71b36b9ac9e4093181f7939cdc576cfa1cb3 /etc/completions/_initd
parent668e1b4daddbb0e50df74feb965690a324c9512f (diff)
initd completion: Configure matching mode via zstyle
Diffstat (limited to 'etc/completions/_initd')
-rw-r--r--etc/completions/_initd8
1 files changed, 8 insertions, 0 deletions
diff --git a/etc/completions/_initd b/etc/completions/_initd
index e1c81b2..3da387c 100644
--- a/etc/completions/_initd
+++ b/etc/completions/_initd
@@ -1,11 +1,19 @@
#compdef Start Restart Stop Reload
## vim:ft=zsh
+## Note: This script parses the files in /etc/init.d to generate the matches.
+## If you'd prefer to just have all the files in /etc/init.d as arguments,
+## write "zstyle ':completion:*:*:_initd' all-files true" into your zshrc
typeset arguments file bang
typeset specific=${service:l}
typeset action='(st(art|op|atus)|(force-|)re(start|load)|debug_(up|down)|dump(|_stats)|add|delete|clean|list)'
typeset -a scripts
+if zstyle -t ':completion:*:*:_initd' all-files; then
+ _arguments -s '*:init script:_path_files -W /etc/init.d -g "*(*)"'
+ return 0
+fi
+
# Most of the loop's content has been taken from the _init_d
# completion function provided with zsh
for file in /etc/init.d/*(*); {