diff options
author | Simon Ruderich <rudi_s@users.sourceforge.net> | 2011-12-09 22:39:08 +0000 |
---|---|---|
committer | Simon Ruderich <rudi_s@users.sourceforge.net> | 2011-12-09 22:39:08 +0000 |
commit | d374f2b1800d54d37a8e4c5299e824874a0489ed (patch) | |
tree | 5e3d67fa016e1cdc7890411fff2ad7590bd2b131 /Completion/Unix/Command/_rlogin | |
parent | 3e1146677f48dbeb697c2744266454d14d5289bb (diff) | |
download | zsh-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/_rlogin')
-rw-r--r-- | Completion/Unix/Command/_rlogin | 29 |
1 files changed, 1 insertions, 28 deletions
diff --git a/Completion/Unix/Command/_rlogin b/Completion/Unix/Command/_rlogin index 0d8355bfb..a04c6d068 100644 --- a/Completion/Unix/Command/_rlogin +++ b/Completion/Unix/Command/_rlogin @@ -1,32 +1,5 @@ #compdef rlogin rsh remsh=rsh rcp -_rcp_remote_files () { - # There should be coloring based on all the different ls -F classifiers. - local expl remfiles remdispf remdispd suf ret=1 - - if zstyle -T ":completion:${curcontext}:" remote-access; then - remfiles=(${(M)${(f)"$(rsh ${IPREFIX%:} ls -d1F ${(Q)PREFIX%%[^./][^/]#}\* 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 -} - _rlogin () { case "$service" in rlogin) @@ -65,7 +38,7 @@ _rlogin () { if [[ -n "$state" ]]; then if compset -P '*:'; then - _rcp_remote_files && ret=0 + _remote_files -- rsh && ret=0 elif compset -P '*@'; then _wanted hosts expl host _rlogin_hosts -S: && ret=0 else |