2007-09-22 04:52:12 +08:00
|
|
|
function __fish_print_interfaces --description "Print a list of known network interfaces"
|
2016-11-28 13:27:22 +08:00
|
|
|
if test -d /sys/class/net
|
2023-04-26 03:13:57 +08:00
|
|
|
path basename /sys/class/net/*
|
2016-11-28 13:27:22 +08:00
|
|
|
else # OSX/BSD
|
2017-12-11 22:16:52 +08:00
|
|
|
set -l os (uname)
|
2020-03-10 02:36:12 +08:00
|
|
|
if string match -e -q BSD -- $os
|
2017-12-11 22:16:52 +08:00
|
|
|
command ifconfig | string match -e -r '^[a-z]' | string replace -r ':.*' '' | string split ' '
|
|
|
|
else
|
|
|
|
command ifconfig -l | string split ' '
|
|
|
|
end
|
2016-11-28 13:27:22 +08:00
|
|
|
end
|
2007-09-22 04:52:12 +08:00
|
|
|
end
|