From 965b142acd99b31ca8449b3d85b1f8407c385399 Mon Sep 17 00:00:00 2001 From: Jason Date: Tue, 3 Dec 2019 19:40:44 +0900 Subject: [PATCH] Move __fish_print_zfs_* into zfs completion script --- share/completions/zfs.fish | 16 +++++++++++++++- share/functions/__fish_print_zfs_bookmarks.fish | 5 ----- .../functions/__fish_print_zfs_filesystems.fish | 3 --- share/functions/__fish_print_zfs_volumes.fish | 3 --- 4 files changed, 15 insertions(+), 12 deletions(-) delete mode 100644 share/functions/__fish_print_zfs_bookmarks.fish delete mode 100644 share/functions/__fish_print_zfs_filesystems.fish delete mode 100644 share/functions/__fish_print_zfs_volumes.fish diff --git a/share/completions/zfs.fish b/share/completions/zfs.fish index 8dd63fa7b..6b008fb49 100644 --- a/share/completions/zfs.fish +++ b/share/completions/zfs.fish @@ -1,5 +1,5 @@ # Fish completions for the OpenZFS zfs command -# Possible enhancements: +# TODO Possible enhancements: # - add a test to propose iSCSI and Trusted Extensions completions only when such system is present; # - Illumos man pages suggests that it does not support nbmand nor atime mount option, so these properties should be proposed only when available # - generally, propose properties only when the current OS and ZFS versions support them; @@ -200,6 +200,20 @@ function __fish_zfs_list_permissions end | string match -r '@[[:alnum:]]*' | sort -u end +function __fish_print_zfs_bookmarks -d "Lists ZFS bookmarks, if the feature is enabled" + if __fish_is_zfs_feature_enabled 'feature@bookmarks' + zfs list -t bookmark -o name -H + end +end + +function __fish_print_zfs_filesystems -d "Lists ZFS filesystems" + zfs list -t filesystem -o name -H +end + +function __fish_print_zfs_volumes -d "Lists ZFS volumes" + zfs list -t volume -o name -H +end + complete -c zfs -f -n '__fish_zfs_needs_command' -s '?' -a '?' -d 'Display a help message' complete -c zfs -f -n '__fish_zfs_needs_command' -a 'create' -d 'Create a volume or filesystem' complete -c zfs -f -n '__fish_zfs_needs_command' -a 'destroy' -d 'Destroy a dataset' diff --git a/share/functions/__fish_print_zfs_bookmarks.fish b/share/functions/__fish_print_zfs_bookmarks.fish deleted file mode 100644 index 569e7a9a4..000000000 --- a/share/functions/__fish_print_zfs_bookmarks.fish +++ /dev/null @@ -1,5 +0,0 @@ -function __fish_print_zfs_bookmarks -d "Lists ZFS bookmarks, if the feature is enabled" - if __fish_is_zfs_feature_enabled 'feature@bookmarks' - zfs list -t bookmark -o name -H - end -end diff --git a/share/functions/__fish_print_zfs_filesystems.fish b/share/functions/__fish_print_zfs_filesystems.fish deleted file mode 100644 index 8b314669d..000000000 --- a/share/functions/__fish_print_zfs_filesystems.fish +++ /dev/null @@ -1,3 +0,0 @@ -function __fish_print_zfs_filesystems -d "Lists ZFS filesystems" - zfs list -t filesystem -o name -H -end diff --git a/share/functions/__fish_print_zfs_volumes.fish b/share/functions/__fish_print_zfs_volumes.fish deleted file mode 100644 index ec1eb5842..000000000 --- a/share/functions/__fish_print_zfs_volumes.fish +++ /dev/null @@ -1,3 +0,0 @@ -function __fish_print_zfs_volumes -d "Lists ZFS volumes" - zfs list -t volume -o name -H -end