mirror of
https://github.com/fish-shell/fish-shell.git
synced 2024-11-25 09:39:52 +08:00
21ddfabb8d
* Simplify and fix `__fish_is_zfs_feature_enabled` Previously `__fish_is_zfs_feature_enabled` was doing `<whitespace>$queried_feature<whitespace>` pattern matching which was skipping the state part expected in the follow-up checking code. Passing the dataset/snapshot in a `target` argument is pointless. As none of the existing code attempts to do this plus it is also a private function (`__` prefix), rename of the argument and removal of extra text replacement should not be considered a breaking change. * Changed the `&& \` into `|| return` * Run `fish_indent`
8 lines
312 B
Fish
8 lines
312 B
Fish
function __fish_is_zfs_feature_enabled \
|
|
-a feature pool \
|
|
-d "Returns 0 if the given ZFS pool feature is active or enabled for the given pool or for any pool if none specified"
|
|
|
|
type -q zpool || return
|
|
zpool get -H -o value $feature $pool 2>/dev/null | string match -rq '^(enabled|active)$'
|
|
end
|