Commit | Line | Data |
---|---|---|
16629c8a LC |
1 | Bash-completion is written with FHS in mind where completion scripts |
2 | all get added to /usr/share/bash-completion/completions and are picked | |
3 | up by the dynamic completion loader from there---whether they are | |
4 | part of bash-completion or installed by another package. | |
5 | ||
6 | On Guix systems, we want not only to search within bash-completion's own | |
7 | directory, but also in the user's profile and in the system profile. | |
8 | This is what this patch does. | |
9 | ||
ba6d25f3 | 10 | |
504be7db TGR |
11 | --- a/bash_completion |
12 | +++ b/bash_completion | |
13 | @@ -2016,7 +2016,13 @@ complete -F _minimal '' | |
16629c8a | 14 | |
ba6d25f3 TČ |
15 | __load_completion() |
16 | { | |
17 | - local -a dirs=( ${BASH_COMPLETION_USER_DIR:-${XDG_DATA_HOME:-$HOME/.local/share}/bash-completion}/completions ) | |
18 | + local -a dirs=( | |
19 | + "$HOME/.guix-profile/share/bash-completion/completions/$base" | |
20 | + "$HOME/.guix-profile/etc/bash_completion.d/$base" | |
21 | + "/run/current-system/profile/share/bash-completion/completions/$base" | |
22 | + "/run/current-system/profile/etc/bash_completion.d/$base" | |
23 | + ${BASH_COMPLETION_USER_DIR:-${XDG_DATA_HOME:-$HOME/.local/share}/bash-completion}/completions ) | |
24 | + | |
504be7db | 25 | local OIFS=$IFS IFS=: dir cmd="${1##*/}" compfile |
ba6d25f3 TČ |
26 | for dir in ${XDG_DATA_DIRS:-/usr/local/share:/usr/share}; do |
27 | dirs+=( $dir/bash-completion/completions ) |