about summary refs log tree commit diff
path: root/Completion/Unix/Command/_rsync
diff options
context:
space:
mode:
authorAndrey Borzenkov <bor@users.sourceforge.net>2005-04-03 11:57:02 +0000
committerAndrey Borzenkov <bor@users.sourceforge.net>2005-04-03 11:57:02 +0000
commitaac33a33a143aefacbea64a803a84327fbc84bde (patch)
treec6794b2cfd1eee651428793dc39b93f3a63fbe2c /Completion/Unix/Command/_rsync
parentda3121ea10f6f634408dd78a932d30c46e4affad (diff)
downloadzsh-aac33a33a143aefacbea64a803a84327fbc84bde.tar.gz
zsh-aac33a33a143aefacbea64a803a84327fbc84bde.tar.xz
zsh-aac33a33a143aefacbea64a803a84327fbc84bde.zip
21086: fix module completion (broken in previous patch) and other tweaks
Diffstat (limited to 'Completion/Unix/Command/_rsync')
-rw-r--r--Completion/Unix/Command/_rsync10
1 files changed, 6 insertions, 4 deletions
diff --git a/Completion/Unix/Command/_rsync b/Completion/Unix/Command/_rsync
index aa56b7afe..65a79eaa8 100644
--- a/Completion/Unix/Command/_rsync
+++ b/Completion/Unix/Command/_rsync
@@ -13,7 +13,7 @@ _rsync_user_or_host() {
       _wanted users expl "user" \
 	  _combination -s '[:@]' "${tag}" users-hosts users -q "$@" -
   else
-    [[ $words[CURRENT] = rsync://* ]] || rsync='rsync:rsync: compadd -S/ rsync:/'
+    [[ $words[CURRENT] = rsync://* ]] || rsync='rsync:rsync: compadd -S "" rsync://'
     _alternative \
       'users:user:_users -S @' \
       "hosts:host:_hosts -S '$suf'" \
@@ -26,7 +26,7 @@ local expl remfiles remdispf remdispd remmodules suf ret=1 tag=accounts
 
 if compset -P '*::*/' || compset -P 'rsync://*/*/'; then
 
-  remfiles=(${${(f)"$(_call_program files rsync ${words[CURRENT]%/*}/)"}:#[ 	]*})
+  remfiles=(${${(f)"$(_call_program files rsync ${words[CURRENT]%/*}/ 2>/dev/null)"}:#([ 	]|MOTD:)*})
 
   remdispf=(${remfiles:#d*})
   remdispd=(${(M)remfiles:#d*})
@@ -41,11 +41,13 @@ elif compset -P 1 '*::' || compset -P 1 'rsync://*/'; then
 
   local pat=${words[CURRENT]}
 
-  if [[ $pat = *:: ]]; then
+  if [[ $pat = *::* ]]; then
     pat=${pat%::*}::
+  else
+    pat=${pat%/*}/
   fi
 
-  remfiles=(${${(f)"$(_call_program files rsync $pat)"}:#[ 	]*})
+  remfiles=(${${(f)"$(_call_program files rsync $pat 2>/dev/null)"}:#([ 	]|MOTD:)*})
 
   remmodules=(${remfiles/[ 	]##/:})