Gentoo Archives: gentoo-commits

From: "Torsten Veller (tove)" <tove@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in app-shells/zsh/files: zsh-init.d-gentoo-r1.diff
Date: Mon, 03 Jan 2011 09:31:47
Message-Id: 20110103093138.10BE82004E@flycatcher.gentoo.org
1 tove 11/01/03 09:31:38
2
3 Added: zsh-init.d-gentoo-r1.diff
4 Log:
5 Version bump (#349291)
6
7 (Portage version: 2.2.0_alpha10/cvs/Linux x86_64)
8
9 Revision Changes Path
10 1.1 app-shells/zsh/files/zsh-init.d-gentoo-r1.diff
11
12 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-shells/zsh/files/zsh-init.d-gentoo-r1.diff?rev=1.1&view=markup
13 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-shells/zsh/files/zsh-init.d-gentoo-r1.diff?rev=1.1&content-type=text/plain
14
15 Index: zsh-init.d-gentoo-r1.diff
16 ===================================================================
17 --- zsh-4.3.11/Completion/Unix/Command/_init_d
18 +++ zsh-4.3.11/Completion/Unix/Command/_init_d
19 @@ -1,6 +1,6 @@
20 #compdef -p */(init|rc[0-9S]#).d/*
21
22 -local cmds script
23 +local cmds script opts
24
25 _compskip=all
26
27 @@ -83,10 +83,17 @@
28
29 script=$words[1]
30 [[ $script = */* ]] || script="$(_init_d_fullpath "$script")"
31 +[[ ! -f $script ]] &&
32 + { _message "${words[1]:t} is not an init script" && return }
33
34 cmds=( $(_init_d_get_cmds) ) || return
35
36 -(( $#cmds )) || zstyle -a ":completion:${curcontext}:commands" commands cmds ||
37 - cmds=(start stop)
38 +(( $#cmds )) || zstyle -a ":completion:${curcontext}:commands" commands cmds
39 +opts=(start stop restart pause zap status ineed iuse needsme usesme broken)
40 +
41 +# If we didn't get $cmds from a zstyle, then read init script for opts.
42 +# If script doesn't specify opts, then default to the standard opts.
43 +(( $#cmds )) || cmds=( ${(eQz)${(M)${(f)"$( <$script)"}:#[[:blank:]]#opts=*}#*=} )
44 +(( $#cmds )) || cmds=($opts)
45
46 _sub_commands $cmds