fish-shell/share/functions/__fish_print_interfaces.fish
Fabian Homborg 9367d4ff71 Reindent functions to remove useless quotes
This does not include checks/function.fish because that currently
includes a "; end" in a message that indent would remove, breaking the test.
2020-03-09 19:46:43 +01:00

13 lines
498 B
Fish

function __fish_print_interfaces --description "Print a list of known network interfaces"
if test -d /sys/class/net
set -l interfaces /sys/class/net/*
string replace /sys/class/net/ '' $interfaces
else # OSX/BSD
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
end
end