zsh-workers
 help / color / Atom feed
* [PATCH] _rsync: When completing remote modules, ignore more of the motd.
@ 2020-01-04 14:39 Daniel Shahaf
  0 siblings, 0 replies; only message in thread
From: Daniel Shahaf @ 2020-01-04 14:39 UTC (permalink / raw)
  To: zsh-workers

We cannot use the --no-motd option because it inhibits the modules
listing.

We cannot look for a blank line because there will not be a blank line
if the "motd file" does not end with a newline.

Looking for tabs is an improvement.  Any tabs in the motd will still
cause extraneous matches, but there's nothing we can do about that.

While here, show the modules in the order listed.
---
 Completion/Unix/Command/_rsync | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/Completion/Unix/Command/_rsync b/Completion/Unix/Command/_rsync
index c1404c908..56efd7b13 100644
--- a/Completion/Unix/Command/_rsync
+++ b/Completion/Unix/Command/_rsync
@@ -51,10 +51,11 @@ elif compset -P 1 '*::' || compset -P 1 'rsync://*/'; then
   fi
 
   remfiles=(${${(f)"$(_call_program files rsync $pat 2>/dev/null)"}:#([ 	]|MOTD:)*})
+  remfiles=( ${(M)remfiles:#*$'\t'*} )
 
   remmodules=(${remfiles/[ 	]##/:})
 
-  _describe "remote modules" remmodules -S/
+  _describe -V "remote modules" remmodules -S/
 
 elif compset -P 'rsync://'; then
   _rsync_user_or_host / "$@"

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, back to index

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-01-04 14:39 [PATCH] _rsync: When completing remote modules, ignore more of the motd Daniel Shahaf

zsh-workers

Archives are clonable: git clone --mirror http://inbox.vuxu.org/zsh-workers

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://inbox.vuxu.org/vuxu.archive.zsh.workers


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git