cmd: Fix autocompletion of remote paths with spaces - fixes #3047

This commit is contained in:
Danil Semelenov 2019-03-17 13:15:20 +03:00 committed by Nick Craig-Wood
parent 3bfde5f52a
commit a0d2ab5b4f

View File

@ -57,7 +57,7 @@ __rclone_custom_func() {
else
local path=${cur#*:}
if [[ $path == */* ]]; then
local prefix=${path%/*}
local prefix=$(eval printf '%s' "${path%/*}")
else
local prefix=
fi
@ -66,6 +66,7 @@ __rclone_custom_func() {
local reply=${prefix:+$prefix/}$line
[[ $reply != $path* ]] || COMPREPLY+=("$reply")
done < <(rclone lsf "${cur%%:*}:$prefix" 2>/dev/null)
[[ ! ${COMPREPLY[@]} ]] || compopt -o filenames
fi
[[ ! ${COMPREPLY[@]} ]] || compopt -o nospace
fi