Validation initiale
This commit is contained in:
30
functions/_svc
Normal file
30
functions/_svc
Normal file
@@ -0,0 +1,30 @@
|
||||
#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
|
||||
Reference in New Issue
Block a user