[Bash-completion-commits] [SCM] bash-completion branch, master, updated. 2.0-100-g19ce232

Ville Skyttä ville.skytta at iki.fi
Fri Feb 1 18:07:47 UTC 2013


The following commit has been merged in the master branch:
commit 19ce23282ca6c00b482ac8044b64d91dbb3b62e6
Author: Ville Skyttä <ville.skytta at iki.fi>
Date:   Fri Feb 1 20:06:55 2013 +0200

    wol: Try "ip addr" before ifconfig for finding out broadcast addresses.

diff --git a/completions/wol b/completions/wol
index 02030ab..ce1b7c5 100644
--- a/completions/wol
+++ b/completions/wol
@@ -11,9 +11,11 @@ _wol()
             ;;
         -h|--host|-i|--ipaddr)
             # Broadcast addresses
-            COMPREPLY=( $( PATH=$PATH:/sbin ifconfig -a 2>/dev/null | \
-                sed -ne 's/.*[[:space:]]\{1,\}Bcast:\([^[:space:]]*\).*/\1/p' \
-                    -e 's/.*[[:space:]]\{1,\}broadcast[[:space:]]\{1,\}\([^[:space:]]*\).*/\1/p' ) )
+            local PATH=$PATH:/sbin
+            COMPREPLY=( $( { ip addr show || ifconfig -a; } 2>/dev/null | \
+                sed -ne 's/.*[[:space:]]Bcast:\([^[:space:]]*\).*/\1/p' -ne \
+                's/.*inet.*[[:space:]]brd[[:space:]]\([^[:space:]]*\).*/\1/p' -ne \
+                's/.*[[:space:]]broadcast[[:space:]]\{1,\}\([^[:space:]]*\).*/\1/p' ) )
             _known_hosts_real "$cur"
             return 0
             ;;

-- 
bash-completion



More information about the Bash-completion-commits mailing list