MOON
Server: Apache
System: Linux server1.studioinfinity.com.br 2.6.32-954.3.5.lve1.4.90.el6.x86_64 #1 SMP Tue Feb 21 12:26:30 UTC 2023 x86_64
User: artinside (517)
PHP: 7.4.33
Disabled: exec,passthru,shell_exec,system
Upload Files
File: //usr/share/zsh/4.3.11/functions/_zfs_dataset
#autoload

local -a type typearg list

zparseopts -D -E -a type t+:

[[ -n $type[(r)fs] ]]   && typearg=( filesystem )
[[ -n $type[(r)vol] ]]  && typearg=( $typearg volume )
[[ -n $type[(r)snap] ]] && typearg=( $typearg snapshot )
[[ -n $typearg ]] && typearg=( -t ${(j:,:)typearg} )

datasetlist=( ${="$(zfs list -H -o name $typearg)":#no datasets available} )

expl_type=${typearg[2,-1]//,/\/}
if [[ -n $type[(r)mtpt] ]]; then
	mlist=( ${="$(zfs list -H -o mountpoint $typearg)":#no mountpoints available} )
	datasetlist=( $datasetlist $mlist )
	expl_type="$expl_type/mountpoint"
fi

# compadd "$@" - $list
_wanted dataset expl "$expl_type" _multi_parts "$@" / datasetlist