cmd: Fix tab-completion for remotes with underscores in their names
This commit is contained in:
parent
63bb6de491
commit
2114fd8f26
1 changed files with 2 additions and 2 deletions
|
@ -45,7 +45,7 @@ __rclone_custom_func() {
|
||||||
else
|
else
|
||||||
__rclone_init_completion -n : || return
|
__rclone_init_completion -n : || return
|
||||||
fi
|
fi
|
||||||
if [[ $cur =~ ^[[:alnum:]]*$ ]]; then
|
if [[ $cur =~ ^[[:alnum:]_]*$ ]]; then
|
||||||
local remote
|
local remote
|
||||||
while IFS= read -r remote; do
|
while IFS= read -r remote; do
|
||||||
[[ $remote != $cur* ]] || COMPREPLY+=("$remote")
|
[[ $remote != $cur* ]] || COMPREPLY+=("$remote")
|
||||||
|
@ -54,7 +54,7 @@ __rclone_custom_func() {
|
||||||
local paths=("$cur"*)
|
local paths=("$cur"*)
|
||||||
[[ ! -f ${paths[0]} ]] || COMPREPLY+=("${paths[@]}")
|
[[ ! -f ${paths[0]} ]] || COMPREPLY+=("${paths[@]}")
|
||||||
fi
|
fi
|
||||||
elif [[ $cur =~ ^[[:alnum:]]+: ]]; then
|
elif [[ $cur =~ ^[[:alnum:]_]+: ]]; then
|
||||||
local path=${cur#*:}
|
local path=${cur#*:}
|
||||||
if [[ $path == */* ]]; then
|
if [[ $path == */* ]]; then
|
||||||
local prefix=${path%/*}
|
local prefix=${path%/*}
|
||||||
|
|
Loading…
Reference in a new issue