Don't use camcontrol in FreeBSD zpool completions

It requires root/su privileges to list devices, and we have a great
alternative that already produces the desired results.
This commit is contained in:
Mahmoud Al-Qudsi 2019-03-29 17:43:03 -05:00
parent fc7d11d7b8
commit 93b02dcec4

View file

@ -46,10 +46,7 @@ function __fish_zpool_list_available_vdevs
if test $OS = 'Linux'
find /dev -type b | string replace '/dev/' ''
else if test $OS = 'FreeBSD'
for i in (camcontrol devlist | cut -d "(" -f 2 | cut -d "," -f 1)
set -l files /dev/*
string replace /dev/ '' -- $files | string match -r "^$i"
end
sysctl -an kern.disks | string split ' '
else if test $OS = 'SunOS'
find /dev/dsk -type b | string replace '/dev/' ''
end