[Bash-completion-commits] [SCM] bash-completion branch, master, updated. 1.3-507-g370a550

Ville Skyttä ville.skytta at iki.fi
Sat Nov 5 10:11:08 UTC 2011


The following commit has been merged in the master branch:
commit 370a550baf9466b99783b9cca64127190fd9cea2
Author: Ville Skyttä <ville.skytta at iki.fi>
Date:   Sat Nov 5 12:09:40 2011 +0200

    _mac_addresses: Grab addresses from FreeBSD's ifconfig -a output too.

diff --git a/bash_completion b/bash_completion
index 0252769..c5cd7c9 100644
--- a/bash_completion
+++ b/bash_completion
@@ -793,9 +793,11 @@ _mac_addresses()
     local re='\([A-Fa-f0-9]\{2\}:\)\{5\}[A-Fa-f0-9]\{2\}'
     local PATH="$PATH:/sbin:/usr/sbin"
 
-    # Local interfaces (Linux only?)
+    # Local interfaces (Linux: HWAddr, FreeBSD: ether)
     COMPREPLY+=( $( ifconfig -a 2>/dev/null | sed -ne \
-        "s/.*[[:space:]]HWaddr[[:space:]]\{1,\}\($re\)[[:space:]]*$/\1/p" ) )
+        "s/.*[[:space:]]HWaddr[[:space:]]\{1,\}\($re\)[[:space:]]*$/\1/p" -ne \
+        "s/^[[:space:]]\{1,\}ether[[:space:]]\{1,\}\($re\)[[:space:]]*$/\1/p" \
+        ) )
 
     # ARP cache
     COMPREPLY+=( $( arp -an 2>/dev/null | sed -ne \

-- 
bash-completion



More information about the Bash-completion-commits mailing list