| 1 |
.. _modulepath-option: |
| 2 |
|
| 3 |
``--modulepath`` option |
| 4 |
======================= |
| 5 |
|
| 6 |
This document describes the ``--modulepath`` option added on several |
| 7 |
modulefile commands. |
| 8 |
|
| 9 |
Supported modulefile commands |
| 10 |
----------------------------- |
| 11 |
|
| 12 |
``--modulepath`` option is available on the following modulefile commands: |
| 13 |
|
| 14 |
* :mfcmd:`always-load` |
| 15 |
* :mfcmd:`prereq` (and its alias :mfcmd:`prereq-any`) |
| 16 |
* :mfcmd:`prereq-all` (and its alias :mfcmd:`depends-on`) |
| 17 |
|
| 18 |
Option value |
| 19 |
------------ |
| 20 |
|
| 21 |
``--modulepath`` option accepts a list of modulepaths as value. Multiple |
| 22 |
modulepaths are separated by colon character. |
| 23 |
|
| 24 |
Behavior |
| 25 |
-------- |
| 26 |
|
| 27 |
When option is set, required module should be located in one of the listed |
| 28 |
modulepaths. It should be located either: |
| 29 |
|
| 30 |
* in a modulepath, currently enabled (part of :envvar:`MODULEPATH`), whose |
| 31 |
starting path elements correspond to a directory listed in the option value |
| 32 |
list |
| 33 |
|
| 34 |
* in a modulepath, not part of :envvar:`MODULEPATH`, listed in the option |
| 35 |
value list |
| 36 |
|
| 37 |
For instance if value list of ``--modulepath`` option equals |
| 38 |
``/path/to:/another/path`` and :envvar:`MODULEPATH` currently equals |
| 39 |
``/path/to/modulefiles``. Required module should be located into either |
| 40 |
``/path/to/modulefiles`` or ``/another/path`` directories. |
| 41 |
|
| 42 |
If required module name is not loaded, a module search is performed in the |
| 43 |
resolved directories, as explained above. |
| 44 |
|
| 45 |
If required module name is already loaded, its path location is checked |
| 46 |
against the directories listed in ``--modulepath`` option to verify one |
| 47 |
corresponds to its first path elements. Paths elements are expected to be full |
| 48 |
directory name. For instance ``/path/to/mod`` will not match |
| 49 |
``/path/to/modulefiles`` directory. |
| 50 |
|
| 51 |
.. vim:set tabstop=2 shiftwidth=2 expandtab autoindent: |