2007-09-21 20:52:12 +00:00
|
|
|
function __fish_print_interfaces --description "Print a list of known network interfaces"
|
2016-11-28 05:27:22 +00:00
|
|
|
if test -d /sys/class/net
|
2017-01-18 17:50:43 +00:00
|
|
|
set -l interfaces /sys/class/net/*
|
|
|
|
string replace /sys/class/net/ '' $interfaces
|
2016-11-28 05:27:22 +00:00
|
|
|
else # OSX/BSD
|
2017-12-11 14:16:52 +00:00
|
|
|
set -l os (uname)
|
|
|
|
if string match -e -q "BSD" -- $os
|
|
|
|
command ifconfig | string match -e -r '^[a-z]' | string replace -r ':.*' '' | string split ' '
|
|
|
|
else
|
|
|
|
command ifconfig -l | string split ' '
|
|
|
|
end
|
2016-11-28 05:27:22 +00:00
|
|
|
end
|
2007-09-21 20:52:12 +00:00
|
|
|
end
|