zsh-workers
 help / color / mirror / code / Atom feed
From: Clint Adams <schizo@debian.org>
To: Pierre Habouzit <madcoder@debian.org>, 430146@bugs.debian.org
Cc: zsh-workers@sunsite.dk
Subject: Re: Bug#430146: zsh: please add .ssh/config Hosts to the hosts zstyle completion
Date: Sun, 24 Jun 2007 07:57:27 -0400	[thread overview]
Message-ID: <20070624115727.GA31510@scowler.net> (raw)
In-Reply-To: <20070623113320.GA25562@artemis.internal.dc7.debconf.org>

On Sat, Jun 23, 2007 at 12:33:21PM +0100, Pierre Habouzit wrote:
>   Anyways, I'm not using it anymore because I fancy the
> .ssh/known_hosts more, but I miss it :)

We could do something like this to generate matches from ~/.ssh/config .
Anyone have better ideas?

Index: Completion/Unix/Type/_hosts
===================================================================
RCS file: /cvsroot/zsh/zsh/Completion/Unix/Type/_hosts,v
retrieving revision 1.10
diff -u -r1.10 _hosts
--- Completion/Unix/Type/_hosts	5 Apr 2006 10:04:32 -0000	1.10
+++ Completion/Unix/Type/_hosts	24 Jun 2007 11:52:08 -0000
@@ -48,6 +48,11 @@
         _cache_hosts+=($khosts)
       fi
     done
+
+    if zstyle -t ":completion:${curcontext}:hosts" use-ssh-config; then
+      [[ -r ~/.ssh/config ]] && _cache_hosts+=(${=${${(M)${(f)"$(<~/.ssh/config)"}:#Host*}#Host }:#*\**})
+    fi
+
   fi
 
   _hosts=( "$_cache_hosts[@]" )


       reply	other threads:[~2007-06-24 11:57 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20070622180648.14337.68045.reportbug@localhost>
     [not found] ` <20070622211507.GA16349@scowler.net>
     [not found]   ` <20070622222216.GA9656@artemis.internal.dc7.debconf.org>
     [not found]     ` <20070623074721.GA28769@scowler.net>
     [not found]       ` <20070623113320.GA25562@artemis.internal.dc7.debconf.org>
2007-06-24 11:57         ` Clint Adams [this message]
2007-06-24 19:44           ` Phil Pennock
2007-06-25 14:32             ` Clint Adams
2007-06-25 15:19               ` Peter Stephenson

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=20070624115727.GA31510@scowler.net \
    --to=schizo@debian.org \
    --cc=430146@bugs.debian.org \
    --cc=madcoder@debian.org \
    --cc=zsh-workers@sunsite.dk \
    /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).