about summary refs log tree commit diff
path: root/Completion/Unix/Command/_rsync
diff options
context:
space:
mode:
authorSimon Ruderich <rudi_s@users.sourceforge.net>2011-12-09 22:39:08 +0000
committerSimon Ruderich <rudi_s@users.sourceforge.net>2011-12-09 22:39:08 +0000
commitd374f2b1800d54d37a8e4c5299e824874a0489ed (patch)
tree5e3d67fa016e1cdc7890411fff2ad7590bd2b131 /Completion/Unix/Command/_rsync
parent3e1146677f48dbeb697c2744266454d14d5289bb (diff)
downloadzsh-d374f2b1800d54d37a8e4c5299e824874a0489ed.tar.gz
zsh-d374f2b1800d54d37a8e4c5299e824874a0489ed.tar.xz
zsh-d374f2b1800d54d37a8e4c5299e824874a0489ed.zip
29918: Completion: Add new _remote_files() helper and use it to reduce code duplication.
Diffstat (limited to 'Completion/Unix/Command/_rsync')
-rw-r--r--Completion/Unix/Command/_rsync28
1 files changed, 1 insertions, 27 deletions
diff --git a/Completion/Unix/Command/_rsync b/Completion/Unix/Command/_rsync
index b999c1bbd..f24a06e47 100644
--- a/Completion/Unix/Command/_rsync
+++ b/Completion/Unix/Command/_rsync
@@ -59,33 +59,7 @@ elif compset -P 1 '*::' || compset -P 1 'rsync://*/'; then
 elif compset -P 'rsync://'; then
   _rsync_user_or_host / "$@"
 elif compset -P 1 '*:'; then
-
-  if zstyle -T ":completion:${curcontext}:files" remote-access; then
-    if [[ -z $QIPREFIX ]]
-    then rempat="${PREFIX%%[^./][^/]#}\*"
-    else rempat="${(q)PREFIX%%[^./][^/]#}\*"
-    fi
-    remfiles=(${(M)${(f)"$(_call_program files ssh -a -x ${IPREFIX%:} ls -d1FL "$rempat" 2>/dev/null)"}%%[^/]#(|/)})
-    compset -P '*/'
-    compset -S '/*' || suf='remote file'
-
-    remdispf=(${remfiles:#*/})
-    remdispd=(${(M)remfiles:#*/})
-
-    _tags files
-    while _tags; do
-      while _next_label files expl ${suf:-remote directory}; do
-        [[ -n $suf ]] && compadd "$@" "$expl[@]" -d remdispf \
-	    ${(q)remdispf%[*=@|]} && ret=0 
-	compadd ${suf:+-S/} "$@" "$expl[@]" -d remdispd \
-	    ${(q)remdispd%/} && ret=0
-      done
-      (( ret )) || return 0
-    done
-  else
-    _message -e remote-files 'remote file'
-  fi
-
+  _remote_files -- ssh
 else
   _rsync_user_or_host : "$@"
 fi