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.
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.
13 @@ -2016,7 +2016,13 @@ complete -F _minimal ''
17 - local -a dirs=( ${BASH_COMPLETION_USER_DIR:-${XDG_DATA_HOME:-$HOME/.local/share}/bash-completion}/completions )
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 )
25 local OIFS=$IFS IFS=: dir cmd="${1##*/}" compfile
26 for dir in ${XDG_DATA_DIRS:-/usr/local/share:/usr/share}; do
27 dirs+=( $dir/bash-completion/completions )