From c86a402077a26fbdbf98ccc99df142f9b517023a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Wed, 29 Jul 2009 00:22:14 +0300 Subject: [PATCH] Load "modules" completion if /etc/profile.d/modules.sh exists even if the "module" alias has not been defined (yet). --- CHANGES | 2 ++ contrib/modules | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) 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 () {