From 495cbb185f5946ab39cfc98a241a88ee4c470693 Mon Sep 17 00:00:00 2001 From: Fabian Homborg Date: Sat, 16 May 2020 23:01:17 +0200 Subject: [PATCH] completions/zpool: Use --inherit-variable The local-exported variable will have disappeared by the time the function is called. "-V"/"--inherit-variable" is meant for something like this. Fixes #7011 --- share/completions/zpool.fish | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/share/completions/zpool.fish b/share/completions/zpool.fish index 67cbd7884..387a10d5a 100644 --- a/share/completions/zpool.fish +++ b/share/completions/zpool.fish @@ -4,7 +4,7 @@ # - for eligible commands, with arguments of different types, only propose second type completions after the first have been selected; for instance, only propose pool members for offline command # - this has been written mainly from manpages, which are known to be out-of-sync with the real feature set; some discrepancies have been addressed, but it is highly likely that others still lie -set -lx OS "" +set -l OS "" switch (uname) case Linux set OS Linux @@ -42,7 +42,7 @@ function __fish_zpool_list_used_vdevs -a pool zpool list -Hv | string replace -rf "^\t([^\t]+).*" '$1' | string match -rv '^(spare|log|cache|mirror|raidz.?)' end -function __fish_zpool_list_available_vdevs +function __fish_zpool_list_available_vdevs -V OS if test $OS = Linux find /dev -type b | string replace /dev/ '' else if test $OS = FreeBSD @@ -113,7 +113,7 @@ function __fish_zpool_list_vdev_types echo -e "cache\tL2ARC device" end -function __fish_zpool_list_ro_properties +function __fish_zpool_list_ro_properties -V OS echo -e "alloc\tPhysically allocated space" if contains -- $OS SunOS Linux echo -e "available\tAvailable space"