Red Hat Bugzilla – Bug 1264094
RFE: Please add XDG_DATA_DIRS support to bash-completion
Last modified: 2017-07-25 04:02:05 EDT
Description of problem:
It is useful in certain situations to have additional completions available which get activated on-demand. The example use-case is software collections. By enabling a collection a new file system hierarchy is made available. Thus new binaries can be made available this way as well. For such binaries it would be great to have bash completions as well.
Typical use case is:
1. Activate collection: "scl enable <collection-name> bash"
2. Have new binary in /opt/<root>/<scl-name>/root/usr/bin/ available.
3. Similarly, bash completions could be added to existing completions by
also loading completions from /opt/<root>/<scl-name>/root/usr/share/bash-completion/completions
One way to achieve this is for bash-completion to read the XDG_DATA_DIRS variable for locations from where to source additional completions (in addition to XDG_DATA_HOME). Software collections could then set the XDG_DATA_DIRS env variable accordingly.
An example setting of XDG_DATA_DIRS could be:
Makes sense, implemented upstream: