Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Completion

Andy Spiegl wrote:

> Hi Sven,
> > > tcsh has a completion rule like this:
> > >  complete rcp 'c%*@*:%`set q=$:-0;set q="$q:s/@/ /";set q="$q:s/:/ /";set q=($q " ");rsh $q[2] -l $q[1] ls -dp $q[3]\*`%' 'c%*:%`set q=$:-0;set q="$q:s/:/ /";set q=($q " ");rsh $q[1] ls -dp $q[2]\*`%' 'c%*@%$hosts%:' 'C@[./$~]*@f@'  'n/*/$hosts/:'
> > 
> > Urgh. Anyone want to argue about the syntax of compctl or the
> > completion functions again? ;-)
> :-)
> > Eh? The completion system contains functions[1] for rcp and scp, so it
> > should work out-of-the-box.
> Hm, no, not really.  Maybe I am blind (happens too often anyway), but here
> only user@host and option completions are done.  But maybe - from looking
> at the tcsh-code - it was not clear what I meant.

No it wasn't... until I now looked closer and found the calls to `rsh'.

> Say I press TAB after this:
>  $ scp foo me@bar:/usr/local/_
> Then I would like to see the files and directories on the remote host "bar",
> but what I see is the possible completions for my own host.

Hm. Depending on what you think about us[1], you may think that we:

1) weren't sure if we should do that (and how: using `rsh ... ls' or
   zftp), because there may be systems without rsh (offering only
   ssh), because you may need something like .rhosts for this to work, 
   which is evil, because it can get pretty expensive, right[2]?
2) were just too lazy to implement that[3]


[1] I think I wrote the two initially, but I also think someone else
    had his fingers in them after that.
[2] This only really means that we should make it configurable: to use 
    either rsh or zftp or not try remote-completion and so on...
[3] Actually, I *had* thought about trying to do that, was slightly
    scared because of 2) and then forgot.

Sven Wischnowsky                         wischnow@xxxxxxxxxxxxxxxxxxxxxxx

Messages sorted by: Reverse Date, Date, Thread, Author