Skip to content

Commit d245df0

Browse files
committed
Add ability to test a shell name on "module-info shell"
Update Tcl "module-info shell" command to be able to test a shell name argument and return if this shell name corresponds to the current shell of the user. This change helps to get the same behavior than Environment Modules (introduced in version 4.0) and makes Lmod compatible with the Tcl modulefile produced by the Singularity HPC tool.
1 parent 1f416cc commit d245df0

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/tcl2lua.tcl

+9-1
Original file line numberDiff line numberDiff line change
@@ -381,7 +381,15 @@ proc module-info {what {more {}}} {
381381
}
382382
}
383383
"shell" {
384-
return $g_shellName
384+
if {$more ne {}} {
385+
if {$g_shellName eq $more} {
386+
return 1
387+
} else {
388+
return 0
389+
}
390+
} else {
391+
return $g_shellName
392+
}
385393
}
386394
"shelltype" {
387395
return $g_shellType

0 commit comments

Comments
 (0)