From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6042 invoked by alias); 26 Sep 2015 18:00:54 -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: 36643 Received: (qmail 14354 invoked from network); 26 Sep 2015 18:00:54 -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] _zfs_dataset: only use -t share solaris systems Date: Sat, 26 Sep 2015 14:00:41 -0400 Message-Id: <1443290442-7394-1-git-send-email-llua@gmx.com> X-Mailer: git-send-email 2.5.1 X-Provags-ID: V03:K0:C9xE2TGXhBwp5fOxtRgE8pqi0OK/W+TX5E8KsN7Nm4YX1qVhbpp J0VY/6AxMPlLwQkNqMTM2iFTK7QQlgaA8l/7h29cxVU19HYZaQrM2rglckn85I6jwXNR1sa cxVwQwHi2kCpBuW3cNjo+79NI4bOFi3ltjw4I4yPtOMICyC/3j3D1gTh2ffL9whRcyZjSbX TZZlCXPb06Z0vqBnXRCUQ== X-UI-Out-Filterresults: notjunk:1;V01:K0:xCQyTzxCISE=:TorFI+CxccwAfc+tQFRvuj hcAGyPcWO2gIz16FEuDygjGh9ayCq6/uTpXANIoHHJLa6M4aA2fFJUxlcA0NIZkC3Fu3KD32r Feb7U2jWKHPE+GIRo+esPcI0o+ONlXG26FCYoNqAgfkOwF4A7k0LNxeML2evC6221IQmJTFeq 3F+HfpPLQvJqghJeF6zXTvyI15Egb7a9B5c95byDMM2vhi2E1ibNR0g/41bxZ3YDsFPOm2jMe tFyuPbtbXS9qFBKpiLrLJ+EaaPZCzxy1iUvtLS73tWUlsQqJgq0V+rhbB9JZHARxJo4X58RPK poA43ksxMcsRV+60MWeAlT4QOLnerJ/L/UAo1Tu6Ip0pyYuqXMCoSWXjtJEn99Oq2y0gPjLib 98ATWpEKs9kxvS/LulX1XPGZIxu/oL0dgJQBKWJ9BiudNG32TRqNaQcny3OI4y0Y6vvCgkRLP 9t7PmCU6mvw+l3EA6he4eAi9rATWwGng/hRcLaKPEIqLBtdd0PgxXpVUHGRj9Gam0CEr+UIVq giQLqbP99NITelCAxHjhkssQnmmjl6gLaG+I6TROmie1tF9LcbVAnIbDj9DARxfbJaOosjKnt L0g6lDFG7laNwcGT/5qYT8reRRvqxx1UU0pSoe+JuYcXIc8RESHf0L0R1/ip58s8sa1XGdk2l 1WmMEASuG/RwMDCKEWUd0UcIB1iMVU32KxKCFqARLLDKnzjerrCWYGv3G7JR+Jtq4GcBB70Bc qYuQX+zr7Ss/fD28 On non-solaris systems with zfs, zfs rename will print an help message due to -t share. The test will work on linux, os x and freebsd. but illumos systems between the years 2010-2012 will still be identified as solaris telling the difference between illumos and solaris isn't very straightforward it seems. http://wiki.illumos.org/display/illumos/Modernizing+Uname I added _pick_variant in _zfs/_zpool and not _zfs_dataset to help with other differences between openzfs and solaris' zfs. In the future someone could test $implementation and handle things appropriately. --- Completion/Unix/Command/_zfs | 4 +++- Completion/Unix/Command/_zpool | 4 +++- Completion/Unix/Type/_zfs_dataset | 2 ++ 3 files changed, 8 insertions(+), 2 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..a1fde90 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 -- 2.5.1