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