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[1] 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: XDG_DATA_DIRS=/usr/local/share:/usr/share:/opt/foo/bar/root/usr/share
Makes sense, implemented upstream: http://anonscm.debian.org/cgit/bash-completion/bash-completion.git/commit/?id=c89dcbbd5510876f6304ef10806b00cc9fda19dc