zsh-workers
 help / color / mirror / code / Atom feed
* [PATCH] Include IPv6 addresses in _bind_addresses results
@ 2012-09-29 13:42 Aaron Schrab
  0 siblings, 0 replies; only message in thread
From: Aaron Schrab @ 2012-09-29 13:42 UTC (permalink / raw)
  To: zsh-workers

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


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2012-09-29 13:41 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-09-29 13:42 [PATCH] Include IPv6 addresses in _bind_addresses results Aaron Schrab

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).