mirror of
https://github.com/envmodules/modules.git
synced 2026-06-18 00:06:53 +08:00
Add hide_auto_loaded configuration option
Add hide_auto_loaded configuration option that controls whether auto loaded modules should be hidden or not (hidden-loaded tag applied). Disabled by default. When configuration is modified it sets the MODULES_HIDE_AUTO_LOADED environment variable.
This commit is contained in:
@@ -90,6 +90,7 @@ array set g_config_defs [list\
|
||||
csh_limit {{} 4000 0 i}\
|
||||
extra_siteconfig {MODULES_SITECONFIG <undef> 1 s {}}\
|
||||
editor {MODULES_EDITOR {@editor@} 0 s {} {} initConfEditor}\
|
||||
hide_auto_loaded {MODULES_HIDE_AUTO_LOADED 0 0 b {0 1}}\
|
||||
home {MODULESHOME {@moduleshome@} 0 s}\
|
||||
icase {MODULES_ICASE @icase@ 0 s {never search always}}\
|
||||
ignore_cache {MODULES_IGNORE_CACHE 0 0 b {0 1}}\
|
||||
|
||||
@@ -1260,6 +1260,14 @@ proc cmdModuleLoad {context uasked tryload loadany tag_list args} {
|
||||
}
|
||||
}
|
||||
|
||||
# hide auto loaded modules if hide_auto_loaded config is enabled
|
||||
if {!$uasked && [getConf hide_auto_loaded]} {
|
||||
setModuleTag $modname hidden-loaded
|
||||
if {$modnamevr ne {} && $modname ne $modnamevr} {
|
||||
setModuleTag $modnamevr hidden-loaded
|
||||
}
|
||||
}
|
||||
|
||||
if {[execute-modulefile $modfile $modname modnamevr $mod]} {
|
||||
break
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user