Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

PATCH: Update _bind_addresses to work with new ifconfig output (and old).

I updated net-tools just before sending out the ssh patches and couldn't
quite work out why the -L and -R completions didn't work anymore, turns
out the ifconfig output changed from

eth0      Link encap:Ethernet  HWaddr xx:xx
          inet addr:  Bcast:  Mask:


eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500  metric 1
        inet  netmask  broadcast

This patch changes the pattern to work with either output format by
checking for the inet keyword instead of addr.

 Completion/Unix/Type/_bind_addresses |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/Completion/Unix/Type/_bind_addresses b/Completion/Unix/Type/_bind_addresses
index 606de3f..cbe7be2 100644
--- a/Completion/Unix/Type/_bind_addresses
+++ b/Completion/Unix/Type/_bind_addresses
@@ -11,5 +11,5 @@ case $OSTYPE in
   linux*) ;&
     _wanted bind-addresses expl 'bind address' compadd "$@" - \
-      ${${${(M)${(f)"$(ifconfig -a)"}:#*addr:*}##*addr:}%% *}
+      ${${${(M)${(f)"$(ifconfig -a)"}:#*inet*}##*inet (addr:)(#c0,1)}%% *}

Messages sorted by: Reverse Date, Date, Thread, Author