From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22251 invoked by alias); 10 Dec 2011 20:30:37 -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: 29993 Received: (qmail 28371 invoked from network); 10 Dec 2011 20:30:36 -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=-0.2 required=5.0 tests=BAYES_00,RDNS_DYNAMIC, SPF_HELO_SOFTFAIL autolearn=no version=3.3.2 Received-SPF: softfail (ns1.primenet.com.au: transitioning SPF record at lorien.comfychair.org does not designate 173.8.144.102 as permitted sender) Date: Sat, 10 Dec 2011 12:14:54 -0800 From: Danek Duvall To: Mikael Magnusson Cc: zsh-workers@zsh.org Subject: Re: PATCH: Update _bind_addresses to work with new ifconfig output (and old). Message-ID: <20111210201454.GD3736@lorien.comfychair.org> Mail-Followup-To: Danek Duvall , Mikael Magnusson , zsh-workers@zsh.org References: <1323545572-10775-1-git-send-email-mikachu@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1323545572-10775-1-git-send-email-mikachu@gmail.com> User-Agent: Mutt/1.5.20 (2010-04-22) On Sat, Dec 10, 2011 at 08:32:52PM +0100, Mikael Magnusson wrote: > 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 If you put a space after "inet" and before the star, it'll work when you have ipv6 addresses (at least on Solaris, whose ifconfig has the new output you show). Otherwise, you get "inet6" as a completion, which is a bit silly. Of course, you don't get the actual ipv6 addresses, but that's probably not a big priority yet. Danek