rsync completions: rework transformation of file list

Accounts for filenames that contain spaces.

Closes #1872.
This commit is contained in:
David Adam 2015-01-23 12:27:23 +08:00
parent 39748870b6
commit 1ff9aba6b1

View File

@ -129,6 +129,6 @@ complete -c rsync -d "Remote path" -n "commandline -ct|sgrep -q :" -a "
commandline -ct|sgrep -Eo '.*:+(.*/)?'
)(
#Get the list of remote files from the specified rsync server
rsync --list-only (commandline -ct|sgrep -Eo '.*:+(.*/)?') ^/dev/null | awk '{if (\$1 ~ \"^d\" ) {print \$NF \"/\";} else {print \$NF;} };'
rsync --list-only (commandline -ct|sgrep -Eo '.*:+(.*/)?') ^/dev/null | sed '/^d/ s,\$,/, ' | tr -s ' '| cut -d' ' -f 5-
)
"