Validation initiale

This commit is contained in:
2018-03-16 12:02:58 +01:00
commit dbb3445f0b
35 changed files with 1926 additions and 0 deletions

30
functions/_svc Normal file
View 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