From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14696 invoked by alias); 26 Sep 2015 19:11:05 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 36646 Received: (qmail 14372 invoked from network); 26 Sep 2015 19:11:04 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.0 From: Eric Cook To: zsh-workers@zsh.org Subject: [PATCH 1/2 v2] _zfs_dataset: only use -t share solaris systems Date: Sat, 26 Sep 2015 15:10:52 -0400 Message-Id: <1443294652-8324-1-git-send-email-llua@gmx.com> X-Mailer: git-send-email 2.5.1 In-Reply-To: <1443290442-7394-1-git-send-email-llua@gmx.com> References: <1443290442-7394-1-git-send-email-llua@gmx.com> X-Provags-ID: V03:K0:OzXNScpLLiTt4TcslPF5hfiW4Q7Ca7tV7k6mlUsXmfBfal64Jok 5ou0Hz0qSmYOHp48wocs1er4IDuQyoP/tPL7/ZuOQax+n0Tt8dRmHggIrsS9oKYnxFV/GCQ fFkG/ULdeJZ/F4RlNiq+kOhWasOO7CSoIvRT9V3pvwM8wvq5gBxbVXucGbeigf5a8NBPL43 4YvZaCSy6ZCqdZ/lUxiZQ== X-UI-Out-Filterresults: notjunk:1;V01:K0:Ntg9xRaua00=:rFSjYzDrELcC5jC8AEXFXG 71smC4J5n4p9ZE4hgr/e5F30yNCxfOGFhxYcZy23qPGZYP3QWMYBp+n2g5XtCt5f8SobEQzqI TMAOCEV4+w3ENSvPugFO3cVIFrH+YO0Yy2OMwcEWj+nMwvUAI371Q/fgmqpFlmzxw90Hj1zk7 YlGwnRBK96rA4NYHUMZz+VSMX+QZwr+tMJuwiCYl5kFTNavK5XVEZJseY8FVM3iERiZdpRwnC KpuLhoyMe9yV46abUpHzksq8sGGjKd+3JidRImIlWHsFWfkc+3NPqqCCpgvFdsYZGS5soXkWJ vYq3nIv5HoKr2qCA9t/zT9EMH1f3n21uaMyycZsvRr1i8wKauFNqvkBqR8DYHA19nX4u1QBg7 kbNZSmpD2pG7P99Z4nWWogDll2AShD3BpyZhm31vOs+EnthO3WjHP86v4GiiI9KgyXbVDaMpK Q9JvDDmtC1tslSWGRWtQNr69mOLvhg9eKeidHtdhQ7RLmj3wENwoH0kL8+vDqiKW1fZgc11AT ZNyz9ppsPTouHCTo05Zfw54E3FwE/AH6cQDv1Jp0d8W1nYDDhyOmWUTtcAOhoarbDR5l59RJK 0kiV1B8njTeXH+b0KoDJLZgGXqtZK3wKYhGXOwjxcqQrJAHgTUUm83NHCdv16ANNmAFDZq0qF wVQbLWMir/Qoe7srxlMBh7QclyL9yJJDG4ybr3Xkfj7On/DiugXzYwMXDj8V3lepaQSqUm8Je 70tDb+u2McxCHWb+ in addition to the previously mentioned stuff, avoids the solaris specific type alias `fs' in favor of `filesystem' in _zfs_dataset. which is used when completing the destination of an zfs rename command. --- Completion/Unix/Command/_zfs | 4 +++- Completion/Unix/Command/_zpool | 4 +++- Completion/Unix/Type/_zfs_dataset | 6 ++++-- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/Completion/Unix/Command/_zfs b/Completion/Unix/Command/_zfs index cd5ad3e..04a92e6 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 f2116dc..53022db 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 64e343f..5fa3e9e 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 -- 2.5.1