From 1ff9aba6b18bd49295cf30de2a2ce7a11013c7cf Mon Sep 17 00:00:00 2001 From: David Adam Date: Fri, 23 Jan 2015 12:27:23 +0800 Subject: [PATCH] rsync completions: rework transformation of file list Accounts for filenames that contain spaces. Closes #1872. --- share/completions/rsync.fish | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/share/completions/rsync.fish b/share/completions/rsync.fish index f749aaa55..aa0fa6594 100644 --- a/share/completions/rsync.fish +++ b/share/completions/rsync.fish @@ -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- ) "