mirror of
https://github.com/rclone/rclone.git
synced 2024-12-23 07:29:35 +01:00
cmd: Fix autocompletion of remote paths with spaces - fixes #3047
This commit is contained in:
parent
3bfde5f52a
commit
a0d2ab5b4f
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user