Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
PATCH: Update _bind_addresses to work with new ifconfig output (and old).
- X-seq: zsh-workers 29987
- From: Mikael Magnusson <mikachu@xxxxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: PATCH: Update _bind_addresses to work with new ifconfig output (and old).
- Date: Sat, 10 Dec 2011 20:32:52 +0100
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=from:to:subject:date:message-id:x-mailer; bh=l15k0oQCqjAnWMnv5qsMoSAvyvMFnIk/5Hk6gyZo6Wg=; b=T4eCGKqOPYftoDkpeef5PmPb80gDaNEdU7YoAg78MLtFCMr5eigTEdNq82AR5hMwAL 24qDfkh+BeNFdikUUbRUhJQZFgAIDh8UpTZUCZfYn3MlaR7RE9M/H2B8uOYCCBYRxG+8 H2TqowNJFbJMxcOX4FR9Kr1jz5YHmw+WkEJJY=
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
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:192.168.1.1 Bcast:192.168.1.255 Mask:255.255.255.0
to
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500 metric 1
inet 192.168.1.1 netmask 255.255.255.0 broadcast 192.168.1.255
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)}%% *}
esac
--
1.7.5.4
Messages sorted by:
Reverse Date,
Date,
Thread,
Author