Skip to content

Commit

Permalink
doc: desc avail module subcmds in modulefile interp ctx
Browse files Browse the repository at this point in the history
  • Loading branch information
xdelaruelle committed Apr 11, 2022
1 parent b184c67 commit 9f8d687
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 11 deletions.
2 changes: 2 additions & 0 deletions NEWS.rst
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,8 @@ Modules 5.1.0 (not yet released)
* Doc: describe :ref:`differences between run-command file and modulefile
interpretation<Modulefile and run-command interp diff>` in
:ref:`modulefile(4)` man page.
* Doc: describe :mfcmd:`module` sub-commands available as modulefile Tcl
command for each interpretation context in :ref:`modulefile(4)` man page.

.. _Code of conduct: https://github.com/cea-hpc/modules/blob/master/CODE_OF_CONDUCT.md
.. _codespell: https://github.com/codespell-project/codespell
Expand Down
53 changes: 42 additions & 11 deletions doc/source/modulefile.rst
Original file line number Diff line number Diff line change
Expand Up @@ -317,17 +317,6 @@ the *modulefile* is being loaded.

.. mfcmd:: module [sub-command] [sub-command-options] [sub-command-args]

Contains the same *sub-commands* as described in the :ref:`module(1)` man
page in the :ref:`Module Sub-Commands` section. Exception made for the
following sub-commands that can only be used outside of a modulefile context:
:subcmd:`path`, :subcmd:`paths`, :subcmd:`autoinit`, :subcmd:`help`,
:subcmd:`clear`, :subcmd:`sh-to-mod`, :subcmd:`edit`, :subcmd:`config`,
:subcmd:`refresh`, :subcmd:`source` and :subcmd:`state`. Also the following
sub-commands cannot be used but have a modulefile command counterpart:
:subcmd:`prepend-path`, :subcmd:`append-path`, :subcmd:`remove-path`,
:subcmd:`is-loaded`, :subcmd:`is-saved`, :subcmd:`is-used`,
:subcmd:`is-avail` and :subcmd:`info-loaded`.

This command permits a *modulefile* to :subcmd:`load` or :subcmd:`unload`
other *modulefiles* or to :subcmd:`use` or :subcmd:`unuse` *modulepaths*. No
checks are made to ensure that the *modulefile* does not try to load itself.
Expand Down Expand Up @@ -364,6 +353,48 @@ the *modulefile* is being loaded.
:option:`--force` are ignored when passed to a :mfcmd:`module` command set in
a *modulefile*.

Not all the *sub-commands* described in the :ref:`Module Sub-Commands`
section of the :ref:`module(1)` man page are available when :mfcmd:`module`
is used as a Modules specific Tcl command. The following table summarizes the
different sub-commands available for each interpretation context.

+--------------------------------+---------------------+---------------------+
| Sub-commands available from | Sub-commands avail\ | Sub-commands avail\ |
| modulefile interpretation | able from :file:`i\ | able from run-comm\ |
| | nitrc` configuration| and (rc) file |
| | file and sourced | interpretation |
| | script file | |
+================================+=====================+=====================+
| :subcmd:`load`, | Same sub-commands | *None* |
| :subcmd:`load-any`, | available than for | |
| :subcmd:`switch`, | modulefile and | |
| :subcmd:`try-load`, | :subcmd:`config` | |
| :subcmd:`unload`, | sub-command. | |
| :subcmd:`unuse`, :subcmd:`use`.| | |
| Also available but not recomm\ | | |
| anded for use from regular | | |
| modulefile: :subcmd:`aliases`, | | |
| :subcmd:`avail`, | | |
| :subcmd:`display`, | | |
| :subcmd:`initadd`, | | |
| :subcmd:`initclear`, | | |
| :subcmd:`initlist`, | | |
| :subcmd:`initprepend`, | | |
| :subcmd:`initrm`, | | |
| :subcmd:`initswitch`, | | |
| :subcmd:`list`, | | |
| :subcmd:`purge`, | | |
| :subcmd:`reload`, | | |
| :subcmd:`restore`, | | |
| :subcmd:`save`, | | |
| :subcmd:`savelist`, | | |
| :subcmd:`saverm`, | | |
| :subcmd:`saveshow`, | | |
| :subcmd:`search`, | | |
| :subcmd:`test`, | | |
| :subcmd:`whatis` | | |
+--------------------------------+---------------------+---------------------+

.. only:: html

.. versionchanged:: 4.7
Expand Down

0 comments on commit 9f8d687

Please sign in to comment.