|
| 1 | +.. _module-warn: |
| 2 | + |
| 3 | +module-warn modulefile command |
| 4 | +============================== |
| 5 | + |
| 6 | +This design document describes the :mfcmd:`module-warn` Tcl command that emits |
| 7 | +warning message when targeted module is loaded. |
| 8 | + |
| 9 | +Need for such command comes from `EESSI`_ software-layer where a warning |
| 10 | +message is printed when loading modules if a file is not found. |
| 11 | + |
| 12 | +.. _EESSI: https://www.eessi.io/ |
| 13 | + |
| 14 | +Command specification |
| 15 | +--------------------- |
| 16 | + |
| 17 | +The command has following syntax:: |
| 18 | + |
| 19 | + module-warn [options] --message text modulefile... |
| 20 | + |
| 21 | +When a ``module-warn`` command applies to an evaluated modulefile: |
| 22 | + |
| 23 | +* message is printed as a warning message when targeted module is evaluated in |
| 24 | + ``load``, ``display``, ``help`` or ``test`` modes. |
| 25 | +* warning message is printed at the end of the modulefile evaluation |
| 26 | +* ``warning`` tag is set on available or loaded module |
| 27 | + |
| 28 | +Like other commands of this kind, modulefile specification accepts advanced |
| 29 | +version specifiers (see |
| 30 | +:ref:`module_version_specification_to_return_all_matching_modules`). |
| 31 | + |
| 32 | +This command is available in modulerc and modulefile evaluation contexts. In |
| 33 | +modulefile context, it could be replaced by :mfcmd:`reportWarning`, but it is |
| 34 | +easier to also enables it in this context to benefit from the options that |
| 35 | +inhibit or enable specifically the warning mechanism. |
| 36 | + |
| 37 | +``module-warn`` accepts options that change warn mechanism: |
| 38 | + |
| 39 | +* ``--not-user``: specify a list of unaffected users |
| 40 | +* ``--not-group``: specify a list of groups whose member are unaffected |
| 41 | +* ``--user``: specify a list of users specifically affected |
| 42 | +* ``--group``: specify a list of groups whose member are specifically affected |
| 43 | +* ``--before``: enables warn mechanism until a given date |
| 44 | +* ``--after``: enables warn mechanism after a given date |
| 45 | +* ``--message``: warning message to print |
| 46 | + |
| 47 | +``warning`` tag |
| 48 | +--------------- |
| 49 | + |
| 50 | +``warning`` tag is introduced to visibly catch modulefiles affected by |
| 51 | +``module-warn``: |
| 52 | + |
| 53 | +* ``W`` is the abbreviation for this tag |
| 54 | +* ``W=30;43`` and ``W=103`` is respectively added to dark and light color |
| 55 | + palettes (same as nearly-forbidden modules) |
| 56 | +* This tag is recorded into collections following standard tag recording |
| 57 | + mechanism |
| 58 | +* This tag cannot be set manually with ``module-tag`` command |
| 59 | +* If ``module-warn`` is used within modulefile, extra match search will not |
| 60 | + find ``warning`` tag of these modules |
| 61 | + |
| 62 | +.. vim:set tabstop=2 shiftwidth=2 expandtab autoindent: |
0 commit comments