zsh-users
 help / color / mirror / code / Atom feed
* a simple question
@ 2007-11-29 13:41 Andy Spiegl
  2007-11-29 13:45 ` Peter Stephenson
  0 siblings, 1 reply; 5+ messages in thread
From: Andy Spiegl @ 2007-11-29 13:41 UTC (permalink / raw)
  To: ZSH User List

I've got an alias "sshadmin" for "ssh -l admin"
In order to have the normal ssh-completion for this alias
I thought it suffices to say:
 compdef _ssh sshadmin

But I was wrong. :-(
Any ideas?

Thanks,
 Andy.

-- 
 In theory, theory and practice are the same.  In practice, they're not.


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: a simple question
  2007-11-29 13:41 a simple question Andy Spiegl
@ 2007-11-29 13:45 ` Peter Stephenson
  2007-11-29 14:07   ` Andy Spiegl
  0 siblings, 1 reply; 5+ messages in thread
From: Peter Stephenson @ 2007-11-29 13:45 UTC (permalink / raw)
  To: ZSH User List

Andy Spiegl wrote:
> I've got an alias "sshadmin" for "ssh -l admin"
> In order to have the normal ssh-completion for this alias
> I thought it suffices to say:
>  compdef _ssh sshadmin
> 
> But I was wrong. :-(

Only in that usually it's unnecessary, unless you have turned on the
option "completealiases".  If you haven't, the alias is expanded by
completion so the completion code sees "ssh -l admin" and everything
works.

-- 
Peter Stephenson <pws@csr.com>                  Software Engineer
CSR PLC, Churchill House, Cambridge Business Park, Cowley Road
Cambridge, CB4 0WZ, UK                          Tel: +44 (0)1223 692070


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: a simple question
  2007-11-29 13:45 ` Peter Stephenson
@ 2007-11-29 14:07   ` Andy Spiegl
  2007-11-29 14:41     ` Peter Stephenson
  0 siblings, 1 reply; 5+ messages in thread
From: Andy Spiegl @ 2007-11-29 14:07 UTC (permalink / raw)
  To: ZSH User List

Peter Stephenson wrote:
> Only in that usually it's unnecessary, unless you have turned on the
> option "completealiases".  If you haven't, the alias is expanded by
> completion so the completion code sees "ssh -l admin" and everything
> works.
Ah, great!  Didn't know that feature yet.
Only that I _dont_ have completealiases turned on and it still doesn't work.

In a "zsh -f" session it does work so it must be something in my settings...
On the other hand, with an ls-alias (alias lh="\ls -lFBh") it works.
So why not with sshadmin?  Any idea?

Thanks,
 Andy.

-- 
 In democracy it's your vote that counts.
 In feudalism it's your count that votes.


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: a simple question
  2007-11-29 14:07   ` Andy Spiegl
@ 2007-11-29 14:41     ` Peter Stephenson
  2007-11-29 15:19       ` Andy Spiegl
  0 siblings, 1 reply; 5+ messages in thread
From: Peter Stephenson @ 2007-11-29 14:41 UTC (permalink / raw)
  To: ZSH User List

Andy Spiegl wrote:
> Peter Stephenson wrote:
> > Only in that usually it's unnecessary, unless you have turned on the
> > option "completealiases".  If you haven't, the alias is expanded by
> > completion so the completion code sees "ssh -l admin" and everything
> > works.
> Ah, great!  Didn't know that feature yet.
> Only that I _dont_ have completealiases turned on and it still doesn't work.

You mean you've tried and completion after

  ssh -l admin

works while completion after

  alias sshadmin="ssh -l admin"
  sshadmin

doesn't?

> In a "zsh -f" session it does work so it must be something in my settings...

I presume you mean even after "compinit", otherwise you're using a
different form of completion.

> On the other hand, with an ls-alias (alias lh="\ls -lFBh") it works.
> So why not with sshadmin?  Any idea?

Try using the debug binding "^X?" to generate an output file which
should show you if it's ever getting as far as ssh completion or is
trying completion for something else.

-- 
Peter Stephenson <pws@csr.com>                  Software Engineer
CSR PLC, Churchill House, Cambridge Business Park, Cowley Road
Cambridge, CB4 0WZ, UK                          Tel: +44 (0)1223 692070


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: a simple question
  2007-11-29 14:41     ` Peter Stephenson
@ 2007-11-29 15:19       ` Andy Spiegl
  0 siblings, 0 replies; 5+ messages in thread
From: Andy Spiegl @ 2007-11-29 15:19 UTC (permalink / raw)
  To: ZSH User List

Peter Stephenson wrote:
> You mean you've tried and completion after
>   ssh -l admin
> works while completion after
>   alias sshadmin="ssh -l admin"
>   sshadmin
> doesn't?
Correct.

> > In a "zsh -f" session it does work so it must be something in my settings...
> 
> I presume you mean even after "compinit"
You are right :-)

> Try using the debug binding "^X?" to generate an output file which
> should show you if it's ever getting as far as ssh completion or is
> trying completion for something else.
^Xh gives me:

lama:~>ssh
tags in context :completion::complete:ssh::
    argument-1 options  (_arguments _ssh)
tags in context :completion::complete:ssh:argument-1:
    hosts users  (_alternative _ssh) 
    hosts        (_hosts _combination _ssh_hosts _alternative _ssh) 
    hosts        (_ssh_hosts    _alternative    _ssh    _normal) 
    users        (_users _combination _ssh_users _alternative _ssh)


lama:~>sshadmin
tags in context :completion::complete:::
    all-files  (_files _default)
tags in context :completion::complete:ssh::
    argument-rest options  (_arguments _ssh _ssh)

The files generated after ^X? differ pretty much, but both mention _ssh.
I put them here:
 http://spiegl.de/zsh/zshdump-ssh.gz
 http://spiegl.de/zsh/zshdump-sshadmin.gz

Thanks,
 Andy.

-- 
 If you're not confused, you're not trying hard enough.


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2007-11-29 15:21 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-11-29 13:41 a simple question Andy Spiegl
2007-11-29 13:45 ` Peter Stephenson
2007-11-29 14:07   ` Andy Spiegl
2007-11-29 14:41     ` Peter Stephenson
2007-11-29 15:19       ` Andy Spiegl

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