| 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 guix home profile, as well
|
| 8 | as in the system profile.
|
| 9 | This is what this patch does.
|
| 10 |
|
| 11 |
|
| 12 | |
| 13 | |
| 14 | @@ -2173,7 +2173,15 @@ complete -F _minimal ''
|
| 15 |
|
| 16 | __load_completion()
|
| 17 | {
|
| 18 | - local -a dirs=(${BASH_COMPLETION_USER_DIR:-${XDG_DATA_HOME:-$HOME/.local/share}/bash-completion}/completions)
|
| 19 | + local -a dirs=(
|
| 20 | + ${BASH_COMPLETION_USER_DIR:-${XDG_DATA_HOME:-$HOME/.local/share}/bash-completion}/completions
|
| 21 | + "$HOME/.guix-profile/share/bash-completion/completions"
|
| 22 | + "$HOME/.guix-profile/etc/bash_completion.d"
|
| 23 | + "$HOME/.guix-home/profile/share/bash-completion/completions"
|
| 24 | + "$HOME/.guix-home/profile/etc/bash_completion.d"
|
| 25 | + "/run/current-system/profile/share/bash-completion/completions"
|
| 26 | + "/run/current-system/profile/etc/bash_completion.d" )
|
| 27 | +
|
| 28 | local ifs=$IFS IFS=: dir cmd="${1##*/}" compfile
|
| 29 | [[ -n $cmd ]] || return 1
|
| 30 | for dir in ${XDG_DATA_DIRS:-/usr/local/share:/usr/share}; do
|
| 31 | dirs+=( $dir/bash-completion/completions )
|