aboutsummaryrefslogtreecommitdiff
path: root/zsh-completion/_rc-service
diff options
context:
space:
mode:
authorWilliam Hubbs <w.d.hubbs@gmail.com>2017-12-07 11:30:32 -0600
committerWilliam Hubbs <w.d.hubbs@gmail.com>2017-12-07 11:30:32 -0600
commit6c456f9383ab0000527b4363bc82fc17850aba18 (patch)
treea481adfeaf5db2dd56c3b87538f1269ad68ef1d2 /zsh-completion/_rc-service
parentd220fc272337b216bff6ac781a7b6be4e6f3caee (diff)
Add zsh-completion support
Diffstat (limited to 'zsh-completion/_rc-service')
-rw-r--r--zsh-completion/_rc-service27
1 files changed, 27 insertions, 0 deletions
diff --git a/zsh-completion/_rc-service b/zsh-completion/_rc-service
new file mode 100644
index 00000000..25c6b4c5
--- /dev/null
+++ b/zsh-completion/_rc-service
@@ -0,0 +1,27 @@
+#compdef 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" $(rc-service --list)
+else
+ case $words[2] in
+ -e|--exists|-r|--resolve)
+ (( CURRENT > 3 )) && return 0
+ _values "service" $(rc-service --list)
+ ;;
+ -*)
+ return 0
+ ;;
+ *)
+ _values "action" stop start restart describe zap
+ ;;
+ esac
+fi
+
+# vim: set et sw=2 ts=2 ft=zsh: