diff options
author | Tanaka Akira <akr@users.sourceforge.net> | 1999-09-10 13:57:31 +0000 |
---|---|---|
committer | Tanaka Akira <akr@users.sourceforge.net> | 1999-09-10 13:57:31 +0000 |
commit | b67e4abb100f67ca05809baab37700eb5ee0a342 (patch) | |
tree | f19c7eb1544bd6071e01155825a7aae3cc99117d /Functions/Zftp/zfget_match | |
parent | bc3256997b737f6158e9768dcf5738a7c0fbb454 (diff) | |
download | zsh-b67e4abb100f67ca05809baab37700eb5ee0a342.tar.gz zsh-b67e4abb100f67ca05809baab37700eb5ee0a342.tar.xz zsh-b67e4abb100f67ca05809baab37700eb5ee0a342.zip |
manual/7767
Diffstat (limited to 'Functions/Zftp/zfget_match')
-rw-r--r-- | Functions/Zftp/zfget_match | 33 |
1 files changed, 22 insertions, 11 deletions
diff --git a/Functions/Zftp/zfget_match b/Functions/Zftp/zfget_match index 677108ede..875fca5f1 100644 --- a/Functions/Zftp/zfget_match +++ b/Functions/Zftp/zfget_match @@ -10,18 +10,29 @@ 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 + _description expl 'remote file' + compadd "$expl[@]" -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 + _description expl 'remote file' + compadd "$expl[@]" -F fignore - ${(P)fcache_name} + else + reply=(${(P)fcache_name}); + fi fi # } |