about summary refs log tree commit diff
path: root/Completion/Unix/Type
diff options
context:
space:
mode:
authorEric Cook <llua@gmx.com>2015-10-19 16:05:01 +0200
committerOliver Kiddle <opk@zsh.org>2015-10-19 16:07:32 +0200
commit878d1272fd18da172441d058c3b6b9b60ef01da9 (patch)
treea57e91beb412d496fe714b49b119be97322d7f24 /Completion/Unix/Type
parentd8f8d3e5340e4f61e70aef68d20a41db4445a66f (diff)
downloadzsh-878d1272fd18da172441d058c3b6b9b60ef01da9.tar.gz
zsh-878d1272fd18da172441d058c3b6b9b60ef01da9.tar.xz
zsh-878d1272fd18da172441d058c3b6b9b60ef01da9.zip
36646: handle solaris/openzfs differences; only use -t share on solaris
Diffstat (limited to 'Completion/Unix/Type')
-rw-r--r--Completion/Unix/Type/_zfs_dataset6
1 files changed, 4 insertions, 2 deletions
diff --git a/Completion/Unix/Type/_zfs_dataset b/Completion/Unix/Type/_zfs_dataset
index 64e343f3a..5fa3e9e50 100644
--- a/Completion/Unix/Type/_zfs_dataset
+++ b/Completion/Unix/Type/_zfs_dataset
@@ -34,6 +34,8 @@ if [[ ${#rsrc} -gt 0 ]]; then
 		typearg=( -t snapshot )
 	elif [[ -n $words[(r)-p] ]]; then
 		typearg=( -t filesystem,volume )
+	elif [[ $implementation == openzfs ]]; then
+		typearg=( -t filesystem,snapshot,volume )
 	else
 		typearg=( -t filesystem,share,snapshot,volume )
 	fi
@@ -50,13 +52,13 @@ if [[ ${#rdst} -gt 0 ]]; then
 	else
 		# The parent dataset must be a filesystem, and can't rename
 		# a dataset into another pool.  Plus we hardcode the expl.
-		typearg=( -t fs -r ${${words[CURRENT - 1]}%%/*} )
+		typearg=( -t filesystem -r ${${words[CURRENT - 1]}%%/*} )
 		expl_type_arr=( -e "parent dataset" )
 	fi
 fi
 
 if [[ -n $type[(r)clone] ]]; then
-	datasetlist=( ${="$(zfs list -H -o name,origin -t fs | awk "\$2 != \"-\" {print \$1}")":#no cloned filesystems available} )
+	datasetlist=( ${="$(zfs list -H -o name,origin -t filesystem | awk "\$2 != \"-\" {print \$1}")":#no cloned filesystems available} )
 else
 	datasetlist=( ${="$(zfs list -H -o name $typearg)":#no datasets available} )
 fi