@@ -978,7 +978,7 @@ the *modulefile* is being loaded.
978978 Tags inherited from other modulefile commands or module states cannot be set
979979 with :mfcmd: `module-tag `. Otherwise an error is returned. Those special tags
980980 are: ``auto-loaded ``, ``forbidden ``, ``hidden ``, ``hidden-loaded ``,
981- ``loaded `` and ``nearly-forbidden ``.
981+ ``loaded ``, ``nearly-forbidden `` and `` warning ``.
982982
983983 When *tag * equals ``sticky `` or ``super-sticky ``, designated *modulefile * is
984984 defined :ref: `Sticky modules `.
@@ -1037,6 +1037,59 @@ the *modulefile* is being loaded.
10371037
10381038 .. versionadded :: 4.1
10391039
1040+ .. mfcmd :: module-warn [options] --message {text message} modulefile...
1041+
1042+ Print warning message when evaluating *modulefile *. This command could be
1043+ placed in one of the :file: `modulecmd.tcl ` rc files or within *modulefiles *.
1044+ Warning is emitted when *modulefile * is evaluated in ``load ``, ``display ``,
1045+ ``test ``, ``help ``.
1046+
1047+ :mfcmd: `module-warn ` command accepts the following options:
1048+
1049+ * ``--after datetime ``
1050+ * ``--before datetime ``
1051+ * ``--not-user {user...} ``
1052+ * ``--not-group {group...} ``
1053+ * ``--user {user...} ``
1054+ * ``--group {group...} ``
1055+
1056+ If ``--after `` option is set, warning is only effective after specified date
1057+ time. Following the same principle, if ``--before `` option is set, warning is
1058+ only effective before specified date time. Accepted date time format is
1059+ ``YYYY-MM-DD[THH:MM] ``. If no time (``HH:MM ``) is specified, ``00:00 `` is
1060+ assumed. ``--after `` and ``--before `` options are not supported on Tcl
1061+ versions prior to 8.5.
1062+
1063+ If ``--not-user `` option is set, warning is not applied if the username of
1064+ the user currently running :file: `modulecmd.tcl ` is part of the list of
1065+ username specified. Following the same approach, if ``--not-group `` option is
1066+ set, warning is not applied if current user is member of one of the groups
1067+ specified. When both options are set, warning is not applied if a match is
1068+ found for ``--not-user `` or ``--not-group ``.
1069+
1070+ If ``--user `` option is set, warning is applied only if the username of the
1071+ user currently running :file: `modulecmd.tcl ` is part of the list of username
1072+ specified. Following the same approach, if ``--group `` option is set, warning
1073+ is applied only if current user is member of one of the groups specified.
1074+ When both options are set, warning is applied if a match is found for
1075+ ``--user `` or ``--group ``. If the same user name is set on both ``--user ``
1076+ and ``--not-user `` options, ``--user `` prevails over ``--not-user ``. If the
1077+ same group name is set on both ``--group `` and ``--not-group ``, ``--group ``
1078+ prevails over ``--not-group ``.
1079+
1080+ Modules in warning included in the result of :subcmd: `avail `, :subcmd: `list `
1081+ or :subcmd: `spider ` sub-commands are reported with a ``warning `` tag applied
1082+ to them. See :ref: `Module tags ` section in :ref: `module(1) `.
1083+
1084+ The parameter *modulefile * may leverage a specific syntax to finely select
1085+ module version (see `Advanced module version specifiers `_ section below). It
1086+ may also be a full path file name to precisely designate one module in a
1087+ specific modulepath.
1088+
1089+ .. only :: html
1090+
1091+ .. versionadded :: 5.6
1092+
10401093.. mfcmd :: module-whatis string
10411094
10421095 Defines a string which is displayed in case of the invocation of the
@@ -1640,9 +1693,9 @@ for each interpretation context.
16401693| | :mfcmd: `module-forbid `, :mfcmd: `module-hide `, |
16411694| | :mfcmd: `module-info `, :mfcmd: `module-tag `, |
16421695| | :mfcmd: `module-version `, :mfcmd: `module-virtual `, |
1643- | | :mfcmd: `modulepath-label `, :mfcmd: `system `, |
1644- | | :mfcmd: `uname `, :mfcmd: `versioncmp ` and standard |
1645- | | Tcl commands |
1696+ | | :mfcmd: `module-warn `, :mfcmd: `modulepath-label `, |
1697+ | | :mfcmd: `system `, :mfcmd: `uname `, |
1698+ | | :mfcmd: ` versioncmp ` and standard Tcl commands |
16461699+---------------------------+-----------------------------------------------------+
16471700
16481701.. note :: Global and user run-command files are interpreted like modulefiles
0 commit comments