commit:     454ecdae27518ef131ee4d42c446dea9ee01386b
Author:     Tim Harder <radhermit <AT> gentoo <DOT> org>
AuthorDate: Sat Mar 29 08:22:33 2014 +0000
Commit:     Tim Harder <radhermit <AT> gentoo <DOT> org>
CommitDate: Sat Mar 29 08:38:08 2014 +0000
URL:        
http://git.overlays.gentoo.org/gitweb/?p=proj/zsh-completion.git;a=commit;h=454ecdae

move _baselayout to _openrc and update existing support for openrc-0.12.4

---
 _baselayout | 80 -------------------------------------------------------------
 _openrc     | 60 ++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 60 insertions(+), 80 deletions(-)

diff --git a/_baselayout b/_baselayout
deleted file mode 100644
index 9ff8360..0000000
--- a/_baselayout
+++ /dev/null
@@ -1,80 +0,0 @@
-#compdef rc-update rc-status rc
-
-# baselayout 1.12.11.1
-#
-# rc        (fully done)
-# rc-update (fully done)
-# rc-status (fully done)
-
-
-local gentoo_runlevels
-gentoo_runlevels=(/etc/runlevels/*(:t))
-
-
-# Stuff for rc
-_rc () {
-       if (( CURRENT == 2 )); then
-           _values "runlevels" $gentoo_runlevels
-       fi
-}
-
-
-# Stuff for rc-status
-_rc-status () {
-    _arguments -s                                                              
         \
-           {'(--all)-a','(-a)--all'}'[Show services at all run levels]'        
            \
-           {'(--list)-l','(-l)--list'}'[Show list of run levels]'              
            \
-           {'(--nocolor)-nc','(-nc)--nocolor'}'[Disable color output]'         
            \
-           {'(--servicelist)-s','(-s)--servicelist'}'[Show all services]'      
            \
-           {'(--unused)-u','(-u)--unused'}'[Show services not assigned to any 
run level]'
-
-       _values 'runlevels' $gentoo_runlevels
-}
-
-
-# Stuff for rc-update
-_rc-update () {
-    local used_init
-
-    used_init=(${=${(M)${(f)"$(rc-update show 2>/dev/null)"}:#*|*[a-z]*}% |*})
-
-    if (( CURRENT == 2 )); then
-       _values "rc-update actions"                      \
-           'add[Add script to a runlevel]'              \
-           'del[Delete script from a runlevel]'         \
-           'show[Show scripts lanched at a runlevel]'   \
-           '-a[Add script to a runlevel]'               \
-           '-d[Delete script from a runlevel]'          \
-           '-s[Show scripts lanched at a runlevel]'
-    elif (( CURRENT == 3 )); then
-           case "$words[2]" in
-                   add|-a)
-                        _values "scripts" /etc/init.d/*~*.sh(:t)
-                   ;;
-                   del|-d)
-                       _values "scripts" $used_init
-                   ;;
-                   show|-s)
-                       _values "runlevels" $gentoo_runlevels   \
-                    '-v[Show all init scripts]'         \
-                    '--verbose[Show all init scripts]'
-                   ;;
-           esac
-    elif (( CURRENT == 4 )); then
-           _values "runlevels" $gentoo_runlevels
-    fi
-}
-
-
-case "$service" in
-       rc-update)
-               _rc-update "$@" && return 0
-               ;;
-       rc-status)
-               _rc-status "$@" && return 0
-               ;;
-       rc)
-               _rc "$@" && return 0
-               ;;
-esac
-

diff --git a/_openrc b/_openrc
new file mode 100644
index 0000000..fd3259d
--- /dev/null
+++ b/_openrc
@@ -0,0 +1,60 @@
+#compdef rc-update rc-status rc
+
+# openrc-0.12.4
+
+local gentoo_runlevels
+gentoo_runlevels=(/etc/runlevels/*(:t))
+
+case "$service" in
+       rc-update)
+               local used_init
+               used_init=(${=${(M)${(f)"$(/sbin/rc-update show 
2>/dev/null)"}:#*|*[a-z]*}% |*})
+
+               if (( CURRENT == 2 )); then
+                       _values "rc-update actions" \
+                               'add[Add script to a runlevel]' \
+                               'del[Delete script from a runlevel]' \
+                               'show[Show scripts lanched at a runlevel]' \
+                               '-a[Add script to a runlevel]' \
+                               '-d[Delete script from a runlevel]' \
+                               '-s[Show scripts lanched at a runlevel]'
+               elif (( CURRENT == 3 )); then
+                       case "$words[2]" in
+                               add|-a)
+                                       _values "service" /etc/init.d/*~*.sh(:t)
+                                       ;;
+                               del|-d)
+                                       _values "service" $used_init
+                                       ;;
+                               show|-s)
+                                       _values "runlevels" $gentoo_runlevels \
+                                               '-v[Show all init scripts]' \
+                                               '--verbose[Show all init 
scripts]'
+                                       ;;
+                       esac
+               elif (( CURRENT == 4 )); then
+                       _values "runlevels" $gentoo_runlevels
+               fi
+               ;;
+       rc-status)
+               _arguments -s \
+                       {'(--all)-a','(-a)--all'}'[Show services at all 
runlevels]' \
+                       {'(--crashed)-c','(-c)--crashed'}'[Show crashed 
services]' \
+                       {'(--list)-l','(-l)--list'}'[Show list of runlevels]' \
+                       {'(--runlevel)-r','(-r)--runlevel'}'[Show the name of 
the current runlevel]' \
+                       {'(--servicelist)-s','(-s)--servicelist'}'[Show all 
services]' \
+                       {'(--unused)-u','(-u)--unused'}'[Show services not 
assigned to any run level]' \
+                       {'(--help)-h','(-h)--help'}'[Print this help output]' \
+                       {'(--nocolor)-C','(-C)--nocolor'}'[Disable color 
output]' \
+                       {'(--version)-V','(-V)--version'}'[Display software 
version]' \
+                       {'(--verbose)-v','(-v)--verbose'}'[Run verbosely]' \
+                       {'(--quiet)-q','(-q)--quiet'}'[Run quietly (Does not 
affect errors)]'
+
+               _values 'runlevels' $gentoo_runlevels
+               ;;
+       rc)
+               if (( CURRENT == 2 )); then
+                       _values "runlevels" $gentoo_runlevels
+               fi
+               ;;
+esac

Reply via email to