From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11754 invoked by alias); 29 Sep 2012 13:41:45 -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: 30711 Received: (qmail 19275 invoked from network); 29 Sep 2012 13:41:34 -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.9 required=5.0 tests=BAYES_00,SPF_HELO_PASS, UNPARSEABLE_RELAY autolearn=ham version=3.3.2 Received-SPF: pass (ns1.primenet.com.au: SPF record at schrab.com designates 50.116.43.67 as permitted sender) From: Aaron Schrab To: zsh-workers@zsh.org Subject: [PATCH] Include IPv6 addresses in _bind_addresses results Date: Sat, 29 Sep 2012 09:42:15 -0400 Message-Id: <1348926135-14777-1-git-send-email-aaron@schrab.com> X-Mailer: git-send-email 1.7.10.4 For IPv6 addresses, ifconfig places a space between "addr:" and the actual address unlike with IPv4 addresses where the address comes immediately after the colon. Remove that space when removing the "addr:" portion so that the actual address doesn't get removed in the next step where everything after the first space is removed to eliminate other information. Also remove everything after the slash character, since IPv6 output includes the netmask. Example output: lo Link encap:Local Loopback inet addr:127.0.0.1 Mask:255.0.0.0 inet6 addr: ::1/128 Scope:Host --- Completion/Unix/Type/_bind_addresses | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Completion/Unix/Type/_bind_addresses b/Completion/Unix/Type/_bind_addresses index 606de3f..3460b79 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)"}:#*addr:*}##*addr:( |)}%%(/| )*} esac -- 1.7.10.4