aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVadim A. Misbakh-Soloviov <mva@mva.name>2014-08-25 18:24:50 +0700
committerVadim A. Misbakh-Soloviov <mva@mva.name>2014-08-25 18:24:50 +0700
commit7134714bf6a778c13aa5b602a2b1f47c1ddbe008 (patch)
tree9fb185fc2b9c8037c93c2fac0ac801236260bd17
parent_eselect: update opengl options (diff)
downloadzsh-completion-7134714bf6a778c13aa5b602a2b1f47c1ddbe008.tar.gz
zsh-completion-7134714bf6a778c13aa5b602a2b1f47c1ddbe008.tar.bz2
zsh-completion-7134714bf6a778c13aa5b602a2b1f47c1ddbe008.zip
_openrc: rc-service support
Signed-off-by: Vadim A. Misbakh-Soloviov <mva@mva.name>
-rw-r--r--_openrc36
1 files changed, 35 insertions, 1 deletions
diff --git a/_openrc b/_openrc
index fd3259d..10519f3 100644
--- a/_openrc
+++ b/_openrc
@@ -1,4 +1,4 @@
-#compdef rc-update rc-status rc
+#compdef rc-update rc-status rc rc-service
# openrc-0.12.4
@@ -6,6 +6,31 @@ local gentoo_runlevels
gentoo_runlevels=(/etc/runlevels/*(:t))
case "$service" in
+ rc-service)
+ if (( CURRENT == 2 )); then
+ _arguments -s \
+ '(-e --exists)'{-e,--exists}"[tests if the service exists or not]" \
+ '(-l --list)'{-l,--list}'[list all available services]' \
+ '(-r --resolve)'{-r,--resolve}'[resolve the service name to an init script]' \
+ '(-C --nocolor)'{-C,--nocolor}'[Disable color output]' \
+ '(-v --verbose)'{-v,--verbose}'[Run verbosely]' \
+ '(-q --quiet)'{-q,--quiet}'[Run quietly]'
+ _values "service" /etc/init.d/*~*.sh(:t)
+ else
+ case $words[2] in
+ -e|--exists|-r|--resolve)
+ (( CURRENT > 3 )) && return 0
+ _values "service" /etc/init.d/*~*.sh(:t)
+ ;;
+ -*)
+ return 0
+ ;;
+ *)
+ _values "action" stop start restart describe zap
+ ;;
+ esac
+ fi
+ ;;
rc-update)
local used_init
used_init=(${=${(M)${(f)"$(/sbin/rc-update show 2>/dev/null)"}:#*|*[a-z]*}% |*})
@@ -58,3 +83,12 @@ case "$service" in
fi
;;
esac
+
+
+# Local Variables:
+# mode: Shell-Script
+# sh-indentation: 2
+# indent-tabs-mode: nil
+# sh-basic-offset: 2
+# End:
+# vim: ft=zsh sw=2 ts=2 et