diff --git a/CHANGES b/CHANGES index 4bee8414..42dd7581 100644 --- a/CHANGES +++ b/CHANGES @@ -96,6 +96,8 @@ bash-completion (1.x) * Associate *.po with poedit, gtranslator, kbabel, and lokalize. * Add xz, xzcat, xzdec, and unxz completion. * Add lzcat and unlzma completion. + * Load "modules" completion if /etc/profile.d/modules.sh exists even if + the "module" alias has not been defined (yet). [ Todd Zullinger ] * Make yum complete on filenames after install, deplist, update and upgrade diff --git a/contrib/modules b/contrib/modules index 532cb9b6..cd267d3f 100644 --- a/contrib/modules +++ b/contrib/modules @@ -17,7 +17,9 @@ # module command is an alias, and the `module avail' command returns # its output as stderr. -type module &>/dev/null && { +# Test for existence of /etc/profile.d/modules.sh too because we may end up +# being sourced before it and thus before the `module' alias has been defined. +have module || [ -f /etc/profile.d/modules.sh ] && { _module_list () {