Skip to content

Commit e421419

Browse files
authored
Fix path_regex check
The case 'path/some` didn't work, because tail was cut off along with '/'. Just need check ${cur} for matching 'path_regex'.
1 parent e001384 commit e421419

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

pgbackrest-completion.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ __pgbackrest_repo_content() {
5252
# archive/
5353
# archive/dem
5454
# archive/demo/arch
55-
[[ ${cur} =~ ${folder_regex} || ${cur%\/*} =~ ${path_regex} ]] && cur_value=${cur%/*} && substr_path="true"
55+
[[ ${cur} =~ ${folder_regex} || ${cur} =~ ${path_regex} ]] && cur_value=${cur%/*} && substr_path="true"
5656
# Get repo content by using 'repo-ls' in json format.
5757
# For 'repo-get', the content is also obtained via 'repo-ls'.
5858
# The logic for type 'link' is equivalent to type 'path'.
@@ -165,4 +165,4 @@ _pgbackrest() {
165165
esac
166166
}
167167

168-
complete -F _pgbackrest pgbackrest
168+
complete -F _pgbackrest pgbackrest

0 commit comments

Comments
 (0)