1 2 3 4 5 6 7 8 9 10 11 12 13
#autoload local -a type typearg local zonelist zparseopts -D -E -a type t+: [[ -n $type[(r)c] ]] && typearg=-c [[ -n $type[(r)i] ]] && typearg=-i zonelist=( ${="$(zoneadm list $typearg)"} ) compadd "$@" - $zonelist