forked from TrueCloudLab/rclone
cmd: Fix autocompletion of remote paths with spaces - fixes #3047
This commit is contained in:
parent
3bfde5f52a
commit
a0d2ab5b4f
1 changed files with 2 additions and 1 deletions
|
@ -57,7 +57,7 @@ __rclone_custom_func() {
|
||||||
else
|
else
|
||||||
local path=${cur#*:}
|
local path=${cur#*:}
|
||||||
if [[ $path == */* ]]; then
|
if [[ $path == */* ]]; then
|
||||||
local prefix=${path%/*}
|
local prefix=$(eval printf '%s' "${path%/*}")
|
||||||
else
|
else
|
||||||
local prefix=
|
local prefix=
|
||||||
fi
|
fi
|
||||||
|
@ -66,6 +66,7 @@ __rclone_custom_func() {
|
||||||
local reply=${prefix:+$prefix/}$line
|
local reply=${prefix:+$prefix/}$line
|
||||||
[[ $reply != $path* ]] || COMPREPLY+=("$reply")
|
[[ $reply != $path* ]] || COMPREPLY+=("$reply")
|
||||||
done < <(rclone lsf "${cur%%:*}:$prefix" 2>/dev/null)
|
done < <(rclone lsf "${cur%%:*}:$prefix" 2>/dev/null)
|
||||||
|
[[ ! ${COMPREPLY[@]} ]] || compopt -o filenames
|
||||||
fi
|
fi
|
||||||
[[ ! ${COMPREPLY[@]} ]] || compopt -o nospace
|
[[ ! ${COMPREPLY[@]} ]] || compopt -o nospace
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Add table
Reference in a new issue