aboutsummaryrefslogtreecommitdiff
path: root/zsh-completion/_rc-service
blob: 25c6b4c53f045d4d0eb005e7e0a52b4ee6a75a5d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
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: