2015-03-12 17:08:04 -04:00
|
|
|
Bash-completion is written with FHS in mind where completion scripts
|
|
|
|
all get added to /usr/share/bash-completion/completions and are picked
|
|
|
|
up by the dynamic completion loader from there---whether they are
|
|
|
|
part of bash-completion or installed by another package.
|
|
|
|
|
|
|
|
On Guix systems, we want not only to search within bash-completion's own
|
2022-08-07 15:42:19 -04:00
|
|
|
directory, but also in the user's profile and guix home profile, as well
|
|
|
|
as in the system profile.
|
2015-03-12 17:08:04 -04:00
|
|
|
This is what this patch does.
|
|
|
|
|
2016-08-07 06:02:27 -04:00
|
|
|
|
2018-03-19 09:43:23 -04:00
|
|
|
--- a/bash_completion
|
|
|
|
+++ b/bash_completion
|
2022-08-07 15:42:19 -04:00
|
|
|
@@ -2173,7 +2173,15 @@ complete -F _minimal ''
|
2015-03-12 17:08:04 -04:00
|
|
|
|
2016-08-07 06:02:27 -04:00
|
|
|
__load_completion()
|
|
|
|
{
|
2022-08-07 15:41:18 -04:00
|
|
|
- local -a dirs=(${BASH_COMPLETION_USER_DIR:-${XDG_DATA_HOME:-$HOME/.local/share}/bash-completion}/completions)
|
2016-08-07 06:02:27 -04:00
|
|
|
+ local -a dirs=(
|
2021-06-15 05:33:23 -04:00
|
|
|
+ ${BASH_COMPLETION_USER_DIR:-${XDG_DATA_HOME:-$HOME/.local/share}/bash-completion}/completions
|
2022-08-31 07:43:57 -04:00
|
|
|
+ "$HOME/.guix-profile/share/bash-completion/completions"
|
|
|
|
+ "$HOME/.guix-profile/etc/bash_completion.d"
|
|
|
|
+ "$HOME/.guix-home/profile/share/bash-completion/completions"
|
|
|
|
+ "$HOME/.guix-home/profile/etc/bash_completion.d"
|
|
|
|
+ "/run/current-system/profile/share/bash-completion/completions"
|
|
|
|
+ "/run/current-system/profile/etc/bash_completion.d" )
|
2016-08-07 06:02:27 -04:00
|
|
|
+
|
2022-08-07 15:41:18 -04:00
|
|
|
local ifs=$IFS IFS=: dir cmd="${1##*/}" compfile
|
|
|
|
[[ -n $cmd ]] || return 1
|
2016-08-07 06:02:27 -04:00
|
|
|
for dir in ${XDG_DATA_DIRS:-/usr/local/share:/usr/share}; do
|
|
|
|
dirs+=( $dir/bash-completion/completions )
|