diff options
author | Daniel Friesel <derf@derf.homelinux.org> | 2008-12-13 13:30:20 +0100 |
---|---|---|
committer | Daniel Friesel <derf@derf.homelinux.org> | 2008-12-13 13:30:20 +0100 |
commit | 75baad96098e75e471bf9b5ca308c520d5a6ec43 (patch) | |
tree | 88bdb40f87b1b5329ac1dbb3c7633bd3bca3cfb2 /etc/completions/_initd | |
parent | 1e56c667827d1aff22a527a8f80dc45bb865a382 (diff) |
Updated function and completion file headers
Diffstat (limited to 'etc/completions/_initd')
-rw-r--r-- | etc/completions/_initd | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/etc/completions/_initd b/etc/completions/_initd index 3da387c..61abd04 100644 --- a/etc/completions/_initd +++ b/etc/completions/_initd @@ -1,8 +1,12 @@ #compdef Start Restart Stop Reload ## vim:ft=zsh +## Completion for the Start, Stop etc. functions introduced in ../function +## ## 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 +## +## Most of this has been taken from the _init_d function provided with zsh typeset arguments file bang typeset specific=${service:l} @@ -14,8 +18,6 @@ if zstyle -t ':completion:*:*:_initd' all-files; then 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/*(*); { read -u0 -k2 bang < $file && [[ $bang == '#!' ]] && [[ -n ${${(j:|:s:|:)${(M)${(f)"$(< $file)"}:#[[:blank:]]#(\'|)(${~action}[[:blank:]]#\|[[:blank:]]#)#${~specific}([[:blank:]]#\|[[:blank:]]#${~action})#(\'|)\)}}//[^-a-z_]} ]] && |