zsh/functions/_svc

30 lines
531 B
Plaintext
Raw Permalink Normal View History

2018-03-16 12:02:58 +01:00
#compdef svcadm svcs
_svc () {
case "$service" in
svcs) _svcs "$@";;
svcadm) _svcadm "$@";;
*) _message "Invalid service $service";;
esac
}
_svcadm () {
local expl prev="$words[CURRENT-1]"
if [[ -n $words[(r)(enable|disable|clear|restart|refresh|mark)] ]] ; then
_message 'ok'
else
_arguments \
'-v:verbose' && return
fi
}
_svcs () {
local -a zones
zones=(a b c)
_arguments \
'-z[zone]:zone:($zones)' \
'*:command:(boot halt install list ready uninstall verify reboot)' && return
}
return 1