diff --git a/NEWS.rst b/NEWS.rst index 1b0fb22a..a3ee6976 100644 --- a/NEWS.rst +++ b/NEWS.rst @@ -99,6 +99,9 @@ Modules 5.1.0 (not yet released) are getting unloaded. Update default :mconfig:`tag_abbrev` configuration option to add an abbreviation for the new tag (``kL``) and default light and dark color palettes. +* Add the :mfcmd:`always-load` modulefile command for compatibility with Lmod + Tcl modulefiles. This command loads designated modulefile and applies the + ``keep-loaded`` tag to it. .. _Code of conduct: https://github.com/cea-hpc/modules/blob/master/CODE_OF_CONDUCT.md diff --git a/doc/source/changes.rst b/doc/source/changes.rst index 89e4aa80..da99d099 100644 --- a/doc/source/changes.rst +++ b/doc/source/changes.rst @@ -870,7 +870,7 @@ The following modulefile Tcl commands appeared on Modules 5. | 5.1 | :mfcmd:`add-property`, :mfcmd:`remove-property`, | | | :mfcmd:`extensions`, :mfcmd:`prereq-any`, | | | :mfcmd:`require-fullname`, :mfcmd:`depends-on`, | -| | :mfcmd:`prereq-all` | +| | :mfcmd:`prereq-all`, :mfcmd:`always-load` | +------------+-----------------------------------------------------------------+ :mfcmd:`system`, :mfcmd:`is-used` diff --git a/doc/source/modulefile.rst b/doc/source/modulefile.rst index 934c4bfc..4d817aff 100644 --- a/doc/source/modulefile.rst +++ b/doc/source/modulefile.rst @@ -65,6 +65,27 @@ the Module commands return the empty string. Some commands behave differently when a *modulefile* is loaded or unloaded. The command descriptions assume the *modulefile* is being loaded. +.. mfcmd:: always-load [--tag taglist] modulefile... + + Load *modulefile* and apply the ``keep-loaded`` tag to it in order to avoid + the automatic unload of this *modulefile* when modules dependent of it are + unloaded. + + *modulefile* is declared as a requirement of currently loading module. This + command acts as an alias of :mfcmd:`module load` command. If more + than one *modulefile* are specified, then this list acts as a Boolean AND + operation, which means all specified *modulefiles* are required. + + The ``--tag`` option accepts a list of module tags to apply to *modulefile* + once loaded in addition to the ``keep-loaded`` tag. *taglist* corresponds to + the concatenation of multiple tags separated by colon character. *taglist* + should not contain tags inherited from *modulefile* state or from other + modulefile commands. + + .. only:: html + + .. versionadded:: 5.1 + .. mfcmd:: append-path [-d C|--delim C|--delim=C] [--duplicates] variable value... See :mfcmd:`prepend-path`.