Skip to content

Commit

Permalink
Fix path_regex check
Browse files Browse the repository at this point in the history
The case 'path/some` didn't work, because tail was cut off along with '/'. Just need check ${cur} for matching 'path_regex'.
  • Loading branch information
woblerr authored Mar 15, 2021
1 parent e001384 commit e421419
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pgbackrest-completion.sh
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ __pgbackrest_repo_content() {
# archive/
# archive/dem
# archive/demo/arch
[[ ${cur} =~ ${folder_regex} || ${cur%\/*} =~ ${path_regex} ]] && cur_value=${cur%/*} && substr_path="true"
[[ ${cur} =~ ${folder_regex} || ${cur} =~ ${path_regex} ]] && cur_value=${cur%/*} && substr_path="true"
# Get repo content by using 'repo-ls' in json format.
# For 'repo-get', the content is also obtained via 'repo-ls'.
# The logic for type 'link' is equivalent to type 'path'.
Expand Down Expand Up @@ -165,4 +165,4 @@ _pgbackrest() {
esac
}

complete -F _pgbackrest pgbackrest
complete -F _pgbackrest pgbackrest

0 comments on commit e421419

Please sign in to comment.