zsh-workers
 help / color / mirror / code / Atom feed
From: Daniel Shahaf <danielsh@apache.org>
To: zsh-workers@zsh.org
Subject: [PATCH] _rsync: When completing remote modules, ignore more of the motd.
Date: Sat,  4 Jan 2020 14:39:44 +0000	[thread overview]
Message-ID: <20200104143944.27115-1-danielsh@apache.org> (raw)

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 / "$@"

                 reply	other threads:[~2020-01-04 14:40 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20200104143944.27115-1-danielsh@apache.org \
    --to=danielsh@apache.org \
    --cc=zsh-workers@zsh.org \
    /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).