From 75baad96098e75e471bf9b5ca308c520d5a6ec43 Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Sat, 13 Dec 2008 13:30:20 +0100 Subject: Updated function and completion file headers --- etc/completions/_initd | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'etc/completions/_initd') 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_]} ]] && -- cgit v1.2.3