zsh-workers
 help / color / mirror / code / Atom feed
From: Aaron Schrab <aaron@schrab.com>
To: zsh-workers@zsh.org
Subject: [PATCH] Include IPv6 addresses in _bind_addresses results
Date: Sat, 29 Sep 2012 09:42:15 -0400	[thread overview]
Message-ID: <1348926135-14777-1-git-send-email-aaron@schrab.com> (raw)

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


                 reply	other threads:[~2012-09-29 13:41 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1348926135-14777-1-git-send-email-aaron@schrab.com \
    --to=aaron@schrab.com \
    --cc=zsh-workers@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).