From 85bf9740a01e168b7b814469892d97fdabc67144 Mon Sep 17 00:00:00 2001 From: Oliver Kiddle Date: Wed, 29 Dec 2021 00:22:33 +0100 Subject: 49668: update zfs completion --- Completion/Unix/Type/_zfs_dataset | 15 +++++++++------ Completion/Unix/Type/_zfs_keysource_props | 15 --------------- 2 files changed, 9 insertions(+), 21 deletions(-) delete mode 100644 Completion/Unix/Type/_zfs_keysource_props (limited to 'Completion/Unix/Type') diff --git a/Completion/Unix/Type/_zfs_dataset b/Completion/Unix/Type/_zfs_dataset index 63384afc6..7edcfd5d7 100644 --- a/Completion/Unix/Type/_zfs_dataset +++ b/Completion/Unix/Type/_zfs_dataset @@ -11,10 +11,12 @@ local expl_type # -t takes arguments (what kinds of datasets) and can appear multiple times zparseopts -D -E e:=expl_type_arr p=paths_allowed r1=rsrc r2=rdst t+:=type -[[ -n $type[(r)fs] ]] && typearg=( filesystem ) -[[ -n $type[(r)vol] ]] && typearg=( $typearg volume ) -[[ -n $type[(r)snap] ]] && typearg=( $typearg snapshot ) -[[ -n $type[(r)share] ]] && typearg=( $typearg share ) +[[ -n $type[(r)fs] ]] && typearg=( filesystem ) +[[ -n $type[(r)vol] ]] && typearg+=( volume ) +[[ -n $type[(r)snap] ]] && typearg+=( snapshot ) +[[ -n $type[(r)share] && $implementation = solaris ]] && typearg+=( share ) +[[ -n $type[(r)bookmark] && $implementation = openzfs ]] && + typearg+=( bookmark ) if [[ -n $typearg ]]; then typearg=( -t ${(j:,:)typearg} ) # We know we're in zfs list if paths_allowed is non-empty. @@ -58,7 +60,7 @@ if [[ ${#rdst} -gt 0 ]]; then fi if [[ -n $type[(r)clone] ]]; then - datasetlist=( ${(f)"$(zfs list -H -o name,origin -t filesystem 2>/dev/null | awk -F $'\t' "\$2 != \"-\" {print \$1}")":#no cloned filesystems available} ) + datasetlist=( ${(f)"$(zfs list -H -o name,origin -t filesystem 2>/dev/null | awk -F$'\t' "\$2 != \"-\" {print \$1}")":#no cloned filesystems available} ) else datasetlist=( ${(f)"$(zfs list -H -o name $typearg 2>/dev/null)":#no datasets available} ) fi @@ -74,4 +76,5 @@ if [[ -n $expl_type_arr[2] ]]; then expl_type=$expl_type_arr[2] fi -_wanted dataset expl "$expl_type" _multi_parts "$@" -q / datasetlist +_description datasets expl "$expl_type" +_multi_parts "$@" "$expl[@]" -q / datasetlist diff --git a/Completion/Unix/Type/_zfs_keysource_props b/Completion/Unix/Type/_zfs_keysource_props deleted file mode 100644 index 01f63257a..000000000 --- a/Completion/Unix/Type/_zfs_keysource_props +++ /dev/null @@ -1,15 +0,0 @@ -#autoload - -local -a suf -local expl - -compset -S ",*" || suf=(-S ,) -if compset -P 1 "*,"; then - _alternative "zfs-keylocator-prompt:\"prompt\" locator:(prompt)" \ - "zfs-keylocator-file:file locator:_path_files" \ - "zfs-keylocator-pkcs11:PKCS#11 locator: " \ - "zfs-keylocator-https:HTTPS URL locator: " -else - _description format expl "keysource format" - compadd $suf -q "$expl[@]" "$@" raw hex passphrase -fi -- cgit 1.4.1