summaryrefslogtreecommitdiff
path: root/Functions/Zftp/zfget_match
diff options
context:
space:
mode:
authorPeter Stephenson <pws@users.sourceforge.net>2000-04-01 20:49:47 +0000
committerPeter Stephenson <pws@users.sourceforge.net>2000-04-01 20:49:47 +0000
commit48525452555a24b9d41748f26b4b77f160f01220 (patch)
treed814ca2f017d9d843fec7d286fefbca78244beb5 /Functions/Zftp/zfget_match
parente025336f2f6d9f107ee1e03b9900f04af0544ba9 (diff)
downloadzsh-48525452555a24b9d41748f26b4b77f160f01220.tar.gz
zsh-48525452555a24b9d41748f26b4b77f160f01220.zip
Updated from list as far as 10376
Diffstat (limited to 'Functions/Zftp/zfget_match')
-rw-r--r--Functions/Zftp/zfget_match31
1 files changed, 20 insertions, 11 deletions
diff --git a/Functions/Zftp/zfget_match b/Functions/Zftp/zfget_match
index 677108ede..0fe2bc06f 100644
--- a/Functions/Zftp/zfget_match
+++ b/Functions/Zftp/zfget_match
@@ -10,18 +10,27 @@ fi
local tmpf=${TMPPREFIX}zfgm$$
if [[ $ZFTP_SYSTEM == UNIX* && $1 == */* ]]; then
- # On the first argument to ls, we usually get away with a glob.
- zftp ls "$1*$2" >$tmpf
- reply=($(<$tmpf))
- rm -f $tmpf
-else
- if (( $#zftp_fcache == 0 )); then
- # Always cache the current directory and use it
- # even if the system is UNIX.
- zftp ls >$tmpf
- zftp_fcache=($(<$tmpf))
+ if [[ -n $WIDGET ]]; then
+ local dir=${1:h}
+ [[ $dir = */ ]] || dir="$dir/"
+ zftp ls -LF $dir >$tmpf
+ local reply
+ reply=(${${${(f)"$(<$tmpf)"}##$dir}%\*})
+ rm -f $tmpf
+ _all_labels files expl 'remote file' compadd -P $dir - $reply
+ else
+ # On the first argument to ls, we usually get away with a glob.
+ zftp ls "$1*$2" >$tmpf
+ reply=($(<$tmpf))
rm -f $tmpf
fi
- reply=($zftp_fcache);
+else
+ local fcache_name
+ zffcache
+ if [[ -n $WIDGET ]]; then
+ _all_labels files expl 'remote file' compadd -F fignore - ${(P)fcache_name}
+ else
+ reply=(${(P)fcache_name});
+ fi
fi
# }