1
0
Fork 0
mirror of git://git.code.sf.net/p/zsh/code synced 2024-05-31 04:16:06 +02:00

35295: Try harder with zftp directory listing

This commit is contained in:
Han Pingtian 2015-05-26 15:53:47 +08:00 committed by Peter Stephenson
parent d2f0b3ccb2
commit 9a6f55dc7a
2 changed files with 10 additions and 1 deletions

View File

@ -1,5 +1,8 @@
2015-05-26 Peter Stephenson <p.stephenson@samsung.com>
* Han Pingtian: 35295: Functions/Zftp/zfcd_match: be more
inventive zftp directory listing.
* Eric Cook: 35292: Completion/Redhat/Command/_yum: complete
installation of local files.

View File

@ -25,7 +25,13 @@ if [[ $ZFTP_SYSTEM = UNIX* ]]; then
fi
# If we're using -F, we get away with using a directory
# to list, but not a glob. Don't ask me why.
reply=(${${(M)${(f)"$(zftp ls -lF $dir)"}:#d*}/(#b)*[[:space:]](*)\//$match[1]})
reply=(${(M)${(f)"$(zftp ls -lF $dir)"}:#d([^[:space:]]##[[:space:]]##)(#c8)?##\/})
# If ls -lF doesn't work, try dir ...
if ! (($#reply)); then
reply=(${(M)${(f)"$(zftp dir $dir)"}:#d([^[:space:]]##[[:space:]]##)(#c8)?##})
fi
reply=(${reply/(#b)d([^[:space:]]##[[:space:]]##)(#c8)([^\/]##)\/#/$match[2]})
# () {
# zftp ls -LF $dir >|$1
# reply=($(awk '/\/$/ { print substr($1, 1, length($1)-1) }' $1))