zsh-workers
 help / color / mirror / code / Atom feed
* trivial patch to _rlogin to make rcp complete more like scp
@ 2000-11-18 15:37 E. Jay Berkenbilt
  2000-11-18 16:50 ` Bart Schaefer
  0 siblings, 1 reply; 2+ messages in thread
From: E. Jay Berkenbilt @ 2000-11-18 15:37 UTC (permalink / raw)
  To: zsh-workers


If you say 

scp file hostTAB

where host is something that unambiguously completes to a host, scp
adds a colon to the end of the host.  If you then hit space, the colon
stays.

If you do the same with rcp, the colon disappears after a space.  The
same thing goes with user@.

I think that keeping the colon is the Right Thing (TM) since it
actually means something.  I often do scp file host: just to copy the
file to my top level home directory.  I do the same thing with rcp but
I have to retype the : to keep it from vanishing.

I'm not convinced that this is the right behavior with the @.  In any
case, this patch takes the -q's off of the _alternative call to
prevent this behavior in _rlogin for rcp.  I went ahead and did it for
the @ case as well so that rcp would be consistent with scp, but it
would also have been reasonable to change _scp to add the -q for the @
case....

The only way I could figure this out was to do a careful comparison
between the _rlogin and _ssh code.  The -q flag to _alternative seems
to be either missing from the documentation or very well hidden.

This patch is relative to the current CVS....

I think I may end too many sentences with strings of four dots....

                                Jay


---------------------------------------------------------------------------

--- _rlogin.qdist	Sat Nov 18 10:05:13 2000
+++ _rlogin	Sat Nov 18 10:25:02 2000
@@ -40,12 +40,12 @@
       if compset -P '*:'; then
 	_files && ret=0
       elif compset -P '*@'; then
-        _wanted hosts expl host _rlogin_hosts -S: -q && ret=0
+        _wanted hosts expl host _rlogin_hosts -S: && ret=0
       else
         _alternative \
 	    'files:: _files' \
-	    'hosts:: _rlogin_all_hosts -qS:' \
-	    'users:: _rlogin_users -qS@' && ret=0
+	    'hosts:: _rlogin_all_hosts -S:' \
+	    'users:: _rlogin_users -S@' && ret=0
       fi
     fi
     return ret


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

* Re: trivial patch to _rlogin to make rcp complete more like scp
  2000-11-18 15:37 trivial patch to _rlogin to make rcp complete more like scp E. Jay Berkenbilt
@ 2000-11-18 16:50 ` Bart Schaefer
  0 siblings, 0 replies; 2+ messages in thread
From: Bart Schaefer @ 2000-11-18 16:50 UTC (permalink / raw)
  To: E. Jay Berkenbilt, zsh-workers

On Nov 18, 10:37am, E. Jay Berkenbilt wrote:
}
} scp file hostTAB
} 
} where host is something that unambiguously completes to a host, scp
} adds a colon to the end of the host.  If you then hit space, the colon
} stays.
} 
} If you do the same with rcp, the colon disappears after a space.  The
} same thing goes with user@.
} 
} I think that keeping the colon is the Right Thing (TM) since it
} actually means something.
} 
} I'm not convinced that this is the right behavior with the @.

I'm pretty sure it's not the right behavior with @.

} The only way I could figure this out was to do a careful comparison
} between the _rlogin and _ssh code.  The -q flag to _alternative seems
} to be either missing from the documentation or very well hidden.

Look closely:

}          _alternative \
}  	    'files:: _files' \
} -	    'hosts:: _rlogin_all_hosts -qS:' \
} -	    'users:: _rlogin_users -qS@' && ret=0
} +	    'hosts:: _rlogin_all_hosts -S:' \
} +	    'users:: _rlogin_users -S@' && ret=0

The -q and -S flags are inside quotation marks; they're not flags to
_alternative, they're flags to _rlogin_all_hosts and _rlogin_users,
which eventually pass them to _combination which passes them to compadd.
This is documented in info, but the comment at the top of _combination
is wildly out of date, particularly with respect to what it says about
how _telnet calls _combination.

-- 
Bart Schaefer                                 Brass Lantern Enterprises
http://www.well.com/user/barts              http://www.brasslantern.com

Zsh: http://www.zsh.org | PHPerl Project: http://phperl.sourceforge.net   


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

end of thread, other threads:[~2000-11-18 16:50 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-11-18 15:37 trivial patch to _rlogin to make rcp complete more like scp E. Jay Berkenbilt
2000-11-18 16:50 ` Bart Schaefer

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