From 440df37b41697031c84b8da1549d0be1f606a027 Mon Sep 17 00:00:00 2001 From: Aaron Bieber Date: Mon, 11 Dec 2017 07:16:52 -0700 Subject: [PATCH] parse *BSD interface names --- share/functions/__fish_print_interfaces.fish | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/share/functions/__fish_print_interfaces.fish b/share/functions/__fish_print_interfaces.fish index d079c150f..b806b8968 100644 --- a/share/functions/__fish_print_interfaces.fish +++ b/share/functions/__fish_print_interfaces.fish @@ -3,6 +3,11 @@ function __fish_print_interfaces --description "Print a list of known network in set -l interfaces /sys/class/net/* string replace /sys/class/net/ '' $interfaces else # OSX/BSD - command ifconfig -l | string split ' ' + 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