Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: PATCH: _hosts
- X-seq: zsh-workers 22192
- From: Danek Duvall <duvall@xxxxxxxxxxxxxx>
- To: Peter Stephenson <p.w.stephenson@xxxxxxxxxxxx>
- Subject: Re: PATCH: _hosts
- Date: Fri, 3 Feb 2006 14:48:17 -0800
- Cc: Zsh hackers list <zsh-workers@xxxxxxxxxx>
- In-reply-to: <200602032240.k13MekZj007527@xxxxxxxxxxxxxxxxx>
- Mail-followup-to: Danek Duvall <duvall@xxxxxxxxxxxxxx>, Peter Stephenson <p.w.stephenson@xxxxxxxxxxxx>, Zsh hackers list <zsh-workers@xxxxxxxxxx>
- Mailing-list: contact zsh-workers-help@xxxxxxxxxx; run by ezmlm
- References: <20060203194501.GC23141@xxxxxxxxxxxxxxxxxxxxx> <200602032240.k13MekZj007527@xxxxxxxxxxxxxxxxx>
On Fri, Feb 03, 2006 at 10:40:45PM +0000, Peter Stephenson wrote:
> > Is there some reason that _hosts uses the hosts tag, but _users doesn't use
> > the users tag?
>
> I think it must be an oversight, given that the manual specifically
> mentions the existence of a users tag (as well as a users style).
Yup. Though changing it now will break anyone who had it working with a
style with an empty tag.
> I'll commit the following...
Cool, thanks. Just one nitty change:
> Index: Completion/Unix/Type/_hosts
> ===================================================================
> RCS file: /cvsroot/zsh/zsh/Completion/Unix/Type/_hosts,v
> retrieving revision 1.6
> diff -u -r1.6 _hosts
> --- Completion/Unix/Type/_hosts 3 Feb 2006 16:32:15 -0000 1.6
> +++ Completion/Unix/Type/_hosts 3 Feb 2006 22:34:33 -0000
> @@ -23,7 +23,7 @@
> fi
>
> if [[ -r ~/.ssh/known_hosts ]]; then
> - _cache_hosts+=( $(sed -e '/^[0-9]*\.[0-9]*\.[0-9]*\.[0-9]/d' -e 's/[ ,].*//p' ~/.ssh/known_hosts) )
> + _cache_hosts+=(${${${(u)${(f)"$(<~/.ssh/known_hosts)"}%%[ ,]*}:#(#s)[0-9]##.[0-9]##.[0-9]##.[0-9]##(#e)}:#(#s)[0-9a-f:]##(#e)})
+ _cache_hosts+=(${${${(u)${(f)"$(<~/.ssh/known_hosts)"}%%[ ,#]*}:#(#s)[0-9]##.[0-9]##.[0-9]##.[0-9]##(#e)}:#(#s)[0-9a-f:]##(#e)})
That is, remove everything after the first # as well, since the file can
have comments like that.
Thanks,
Danek
Messages sorted by:
Reverse Date,
Date,
Thread,
Author