Guidelines for forward bash-completion compatibility
Michał Górny <mgorny <at> gentoo.org>
2014-08-29 18:37:09 GMT
Here are a few short notes on how to properly install bash-completions
so that they will work fine with autoloading support that will be
enabled in bash-completion-2.1-r100.
I will also place the following instructions on the wiki once I figure
out where. Suggestions are welcome :).
1. Completion files are to be installed to the directory specified by
$(get_bashcompdir) from bash-completion-r1 (dobashcomp and newbashcomp
1a. Allowed exception: if the build system has hardcoded
/usr/share/bash-completion/completions path, it is acceptable to leave
it as-is and not use the eclass.
1b. Allowed exception: if the build system uses pkg-config to determine
completionsdir and doesn't allow override, it is acceptable to leave
it as-is. However, you need to DEPEND on app-shells/ebash-completion
then -- so it's better to actually make the path configurable.
2. Completion files must be named after *all* commands they're
completing. For example, completion for pulseaudio has to be named
'pulseaudio' and not 'pulseaudio-bash-completion.sh'.
2a. If a completion file provides completions for multiple commands,
it should be installed for one of the commands, and symlinked for
the others. For example, 'pacat', 'paplay', 'parecord' etc. should be
all symlinked to 'pulseaudio'. Extra aliases can be created using