Gentoo Archives: gentoo-commits

From: Tim Harder <radhermit@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/zsh-completion:master commit in: /
Date: Sat, 29 Mar 2014 08:38:35
Message-Id: 1396082288.454ecdae27518ef131ee4d42c446dea9ee01386b.radhermit@gentoo
1 commit: 454ecdae27518ef131ee4d42c446dea9ee01386b
2 Author: Tim Harder <radhermit <AT> gentoo <DOT> org>
3 AuthorDate: Sat Mar 29 08:22:33 2014 +0000
4 Commit: Tim Harder <radhermit <AT> gentoo <DOT> org>
5 CommitDate: Sat Mar 29 08:38:08 2014 +0000
6 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/zsh-completion.git;a=commit;h=454ecdae
7
8 move _baselayout to _openrc and update existing support for openrc-0.12.4
9
10 ---
11 _baselayout | 80 -------------------------------------------------------------
12 _openrc | 60 ++++++++++++++++++++++++++++++++++++++++++++++
13 2 files changed, 60 insertions(+), 80 deletions(-)
14
15 diff --git a/_baselayout b/_baselayout
16 deleted file mode 100644
17 index 9ff8360..0000000
18 --- a/_baselayout
19 +++ /dev/null
20 @@ -1,80 +0,0 @@
21 -#compdef rc-update rc-status rc
22 -
23 -# baselayout 1.12.11.1
24 -#
25 -# rc (fully done)
26 -# rc-update (fully done)
27 -# rc-status (fully done)
28 -
29 -
30 -local gentoo_runlevels
31 -gentoo_runlevels=(/etc/runlevels/*(:t))
32 -
33 -
34 -# Stuff for rc
35 -_rc () {
36 - if (( CURRENT == 2 )); then
37 - _values "runlevels" $gentoo_runlevels
38 - fi
39 -}
40 -
41 -
42 -# Stuff for rc-status
43 -_rc-status () {
44 - _arguments -s \
45 - {'(--all)-a','(-a)--all'}'[Show services at all run levels]' \
46 - {'(--list)-l','(-l)--list'}'[Show list of run levels]' \
47 - {'(--nocolor)-nc','(-nc)--nocolor'}'[Disable color output]' \
48 - {'(--servicelist)-s','(-s)--servicelist'}'[Show all services]' \
49 - {'(--unused)-u','(-u)--unused'}'[Show services not assigned to any run level]'
50 -
51 - _values 'runlevels' $gentoo_runlevels
52 -}
53 -
54 -
55 -# Stuff for rc-update
56 -_rc-update () {
57 - local used_init
58 -
59 - used_init=(${=${(M)${(f)"$(rc-update show 2>/dev/null)"}:#*|*[a-z]*}% |*})
60 -
61 - if (( CURRENT == 2 )); then
62 - _values "rc-update actions" \
63 - 'add[Add script to a runlevel]' \
64 - 'del[Delete script from a runlevel]' \
65 - 'show[Show scripts lanched at a runlevel]' \
66 - '-a[Add script to a runlevel]' \
67 - '-d[Delete script from a runlevel]' \
68 - '-s[Show scripts lanched at a runlevel]'
69 - elif (( CURRENT == 3 )); then
70 - case "$words[2]" in
71 - add|-a)
72 - _values "scripts" /etc/init.d/*~*.sh(:t)
73 - ;;
74 - del|-d)
75 - _values "scripts" $used_init
76 - ;;
77 - show|-s)
78 - _values "runlevels" $gentoo_runlevels \
79 - '-v[Show all init scripts]' \
80 - '--verbose[Show all init scripts]'
81 - ;;
82 - esac
83 - elif (( CURRENT == 4 )); then
84 - _values "runlevels" $gentoo_runlevels
85 - fi
86 -}
87 -
88 -
89 -case "$service" in
90 - rc-update)
91 - _rc-update "$@" && return 0
92 - ;;
93 - rc-status)
94 - _rc-status "$@" && return 0
95 - ;;
96 - rc)
97 - _rc "$@" && return 0
98 - ;;
99 -esac
100 -
101
102 diff --git a/_openrc b/_openrc
103 new file mode 100644
104 index 0000000..fd3259d
105 --- /dev/null
106 +++ b/_openrc
107 @@ -0,0 +1,60 @@
108 +#compdef rc-update rc-status rc
109 +
110 +# openrc-0.12.4
111 +
112 +local gentoo_runlevels
113 +gentoo_runlevels=(/etc/runlevels/*(:t))
114 +
115 +case "$service" in
116 + rc-update)
117 + local used_init
118 + used_init=(${=${(M)${(f)"$(/sbin/rc-update show 2>/dev/null)"}:#*|*[a-z]*}% |*})
119 +
120 + if (( CURRENT == 2 )); then
121 + _values "rc-update actions" \
122 + 'add[Add script to a runlevel]' \
123 + 'del[Delete script from a runlevel]' \
124 + 'show[Show scripts lanched at a runlevel]' \
125 + '-a[Add script to a runlevel]' \
126 + '-d[Delete script from a runlevel]' \
127 + '-s[Show scripts lanched at a runlevel]'
128 + elif (( CURRENT == 3 )); then
129 + case "$words[2]" in
130 + add|-a)
131 + _values "service" /etc/init.d/*~*.sh(:t)
132 + ;;
133 + del|-d)
134 + _values "service" $used_init
135 + ;;
136 + show|-s)
137 + _values "runlevels" $gentoo_runlevels \
138 + '-v[Show all init scripts]' \
139 + '--verbose[Show all init scripts]'
140 + ;;
141 + esac
142 + elif (( CURRENT == 4 )); then
143 + _values "runlevels" $gentoo_runlevels
144 + fi
145 + ;;
146 + rc-status)
147 + _arguments -s \
148 + {'(--all)-a','(-a)--all'}'[Show services at all runlevels]' \
149 + {'(--crashed)-c','(-c)--crashed'}'[Show crashed services]' \
150 + {'(--list)-l','(-l)--list'}'[Show list of runlevels]' \
151 + {'(--runlevel)-r','(-r)--runlevel'}'[Show the name of the current runlevel]' \
152 + {'(--servicelist)-s','(-s)--servicelist'}'[Show all services]' \
153 + {'(--unused)-u','(-u)--unused'}'[Show services not assigned to any run level]' \
154 + {'(--help)-h','(-h)--help'}'[Print this help output]' \
155 + {'(--nocolor)-C','(-C)--nocolor'}'[Disable color output]' \
156 + {'(--version)-V','(-V)--version'}'[Display software version]' \
157 + {'(--verbose)-v','(-v)--verbose'}'[Run verbosely]' \
158 + {'(--quiet)-q','(-q)--quiet'}'[Run quietly (Does not affect errors)]'
159 +
160 + _values 'runlevels' $gentoo_runlevels
161 + ;;
162 + rc)
163 + if (( CURRENT == 2 )); then
164 + _values "runlevels" $gentoo_runlevels
165 + fi
166 + ;;
167 +esac