From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22159 invoked by alias); 10 Dec 2011 19:40:52 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 29987 Received: (qmail 6 invoked from network); 10 Dec 2011 19:40:51 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.6 required=5.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED,RCVD_IN_DNSWL_LOW, T_DKIM_INVALID,T_TO_NO_BRKTS_FREEMAIL autolearn=no version=3.3.2 Received-SPF: pass (ns1.primenet.com.au: SPF record at _spf.google.com designates 209.85.216.50 as permitted sender) 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= From: Mikael Magnusson To: zsh-workers@zsh.org Subject: PATCH: Update _bind_addresses to work with new ifconfig output (and old). Date: Sat, 10 Dec 2011 20:32:52 +0100 Message-Id: <1323545572-10775-1-git-send-email-mikachu@gmail.com> X-Mailer: git-send-email 1.7.5.4 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 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