Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions modulecmd.tcl.in
Original file line number Diff line number Diff line change
Expand Up @@ -5860,6 +5860,21 @@ proc cmdModuleUnuse {args} {
}

if {$unusepath ne ""} {
if {[lsearch -exact $modpathlist $unusepath] >= 0} {
set loadedmodlist [lreverse [getLoadedModuleList]]
foreach mod $loadedmodlist {
set modfile [getPathToModule $mod]
if { [string match $unusepath/* $modfile] } {
reportWarning "Unloading $mod"
set ret [eval cmdModuleUnload "match" $mod]
# sub-module interpretation failed, raise error
if {$ret} {
set errormsg "SUB_FAILED"
}
}
}
}

pushMode "unload"
catch {
unload-path MODULEPATH $unusepath
Expand Down