Skip to content

Commit 177438b

Browse files
committed
doc: desc. --mode option support in lmod compat docs
Signed-off-by: Xavier Delaruelle <[email protected]>
1 parent 88dce81 commit 177438b

File tree

2 files changed

+35
-5
lines changed

2 files changed

+35
-5
lines changed

doc/source/design/lmod-tcl-modulefile-compat.rst

Lines changed: 26 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ Lmod Tcl modulefile compatibility
99
- No evaluation error
1010
- Be as close as possible to the behavior of Lmod
1111

12-
- As of Modules v5.0, the following Tcl modulefile command of Lmod are not
13-
supported. This document is about how supporting these command in Modules
14-
v5.1.
12+
- Starting with Modules v5.1, the following Tcl modulefile commands from Lmod
13+
are now supported. This document describes their implementation and behavior
14+
in Modules v5.1 and later.
1515

1616
- ``add-property``
1717
- ``remove-property``
@@ -382,4 +382,27 @@ Lmod Tcl modulefile compatibility
382382
- These commands are intended for use only within modulerc evaluation context
383383
(not within modulefile)
384384

385+
386+
``--mode`` option
387+
-----------------
388+
389+
Lmod introduced on version ``8.7.60`` the ``--mode`` option (short name
390+
``-m`` or ``-mode``) for the following modulefile commands:
391+
392+
* ``setenv``
393+
* ``unsetenv``
394+
* ``prepend-path``
395+
* ``append-path``
396+
* ``remove-path``
397+
* ``pushenv``
398+
* ``module load``
399+
* ``module load-any``
400+
* ``module try-load``
401+
* ``module unload``
402+
403+
See :ref:`mode-select` design documentation to learn about this option.
404+
405+
This ``--mode`` option is not supported currently on Modules and an error is
406+
raised when it is used in modulefiles.
407+
385408
.. vim:set tabstop=2 shiftwidth=2 expandtab autoindent:

doc/source/modulefile.rst

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2187,8 +2187,9 @@ Compatibility with Lmod Tcl modulefile
21872187

21882188
The :file:`modulecmd.tcl` program supports Tcl modulefile or modulerc written
21892189
for Lmod, the alternative :command:`module` implementation developed in Lua.
2190-
Such modulefiles can be evaluated by Modules without raising error.
2191-
Differences between the two implementations are listed below.
2190+
Except for the specific cases listed below, such modulefiles can be evaluated
2191+
by Modules without producing errors. Key differences between the two
2192+
implementations are outlined below.
21922193

21932194
The ``remove-property`` and ``extensions`` modulefile commands are evaluated
21942195
as a *no-operation* command. No error is obtained if these commands are used
@@ -2197,6 +2198,12 @@ in modulefiles but no change occurs.
21972198
The :mfcmd:`break` command does not accept any argument. A ``msg`` argument
21982199
can be set on Lmod to provide a customized break error message.
21992200

2201+
The :mfcmd:`setenv`, :mfcmd:`unsetenv`, :mfcmd:`prepend-path`,
2202+
:mfcmd:`append-path`, :mfcmd:`remove-path`, :mfcmd:`pushenv` and ``module``
2203+
:mfcmd:`load<module>`, :mfcmd:`load-any<module>`, :mfcmd:`try-load<module>`
2204+
and :mfcmd:`unload<module>` modulefile commands do not support the ``--mode``
2205+
option. An error is raised if this option is used.
2206+
22002207
Use of :mfcmd:`reportError` command aborts modulefile evaluation on Lmod. This
22012208
command only reports an error message on Modules.
22022209

0 commit comments

Comments
 (0)