From 878d1272fd18da172441d058c3b6b9b60ef01da9 Mon Sep 17 00:00:00 2001 From: Eric Cook Date: Mon, 19 Oct 2015 16:05:01 +0200 Subject: 36646: handle solaris/openzfs differences; only use -t share on solaris --- ChangeLog | 4 ++++ Completion/Unix/Command/_zfs | 4 +++- Completion/Unix/Command/_zpool | 4 +++- Completion/Unix/Type/_zfs_dataset | 6 ++++-- 4 files changed, 14 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index f7369b89a..83aef6f64 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ 2015-10-19 Oliver Kiddle + * 36646: Eric Cook: Completion/Unix/Type/_zfs_dataset, + Completion/Unix/Command/_zpool, Completion/Unix/Command/_zfs: + solaris/openzfs differences; only use -t share solaris + * 36889: Eric Cook: Completion/BSD/Command/_sockstat: completion of system specific sockstat options diff --git a/Completion/Unix/Command/_zfs b/Completion/Unix/Command/_zfs index cd5ad3edc..04a92e685 100644 --- a/Completion/Unix/Command/_zfs +++ b/Completion/Unix/Command/_zfs @@ -2,7 +2,7 @@ # Synced with the S11U1 man page _zfs() { - local context state line expl + local context state line expl implementation typeset -A opt_args local -a subcmds rw_properties rw_propnames ro_properties create_properties local -a share_nfs_ro_properties share_nfs_rw_properties @@ -10,6 +10,8 @@ _zfs() { local -a share_ro_properties share_rw_properties local -a difffields delegatable_perms + _pick_variant -r implementation -c 'zpool upgrade -v' openzfs='This system supports ZFS pool feature flags' solaris + subcmds=( "create" "destroy" "clone" "promote" "rename" "snapshot" "rollback" "list" "set" "get" "inherit" "mount" "unmount" diff --git a/Completion/Unix/Command/_zpool b/Completion/Unix/Command/_zpool index f2116dc2e..53022db8a 100644 --- a/Completion/Unix/Command/_zpool +++ b/Completion/Unix/Command/_zpool @@ -2,9 +2,11 @@ # Synced with the S11U1 man page _zpool() { - local context state line expl + local context state line expl implementation local -a subcmds fields ro_props rw_props versions create_properties_dataset + _pick_variant -r implementation -c 'zpool upgrade -v' openzfs='This system supports ZFS pool feature flags' solaris + subcmds=( create destroy add remove list iostat status online offline clear attach detach replace scrub import export 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 -- cgit 1.4.1