Skip to content

Commit 9408131

Browse files
committed
documentation of path_entry_reorder updated
Signed-off-by: Achim Gsell <achim.gsell@psi.ch>
1 parent b9b7009 commit 9408131

1 file changed

Lines changed: 23 additions & 14 deletions

File tree

doc/source/module.rst

Lines changed: 23 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1376,14 +1376,7 @@ Module Sub-Commands
13761376
:mfcmd:`prepend-path`, :mfcmd:`append-path` or :subcmd:`use` target
13771377
a path entry that is already defined in the environment variable.
13781378

1379-
The default behavior of :mfcmd:`prepend-path`, :mfcmd:`append-path` and
1380-
:subcmd:`use` is not to update the value if a path-like environment
1381-
variable, if they target a path entry that is already defined in the
1382-
environment variable. If this config option is set to 1, an existing
1383-
path entry is moved to the beginning respective end unless duplicates
1384-
are allowed. This is the default behavior of Lmod.
1385-
1386-
Default value is 0. It can be changed at installation time with
1379+
Default value is 0. It can be changed at installation time with the
13871380
:instopt:`--with-path-entry-reorder` option. The
13881381
:envvar:`MODULES_PATH_ENTRY_REORDER` environment variable is defined by
13891382
:subcmd:`config` sub-command when changing this configuration option from
@@ -5300,12 +5293,28 @@ ENVIRONMENT
53005293

53015294
.. envvar:: MODULES_PATH_ENTRY_REORDER
53025295

5303-
The default behavior of :mfcmd:`prepend-path`, :mfcmd:`append-path` and
5304-
:subcmd:`use` is not to update the value if a path-like environment
5305-
variable, if they target a path entry that is already defined in the
5306-
environment variable. If this config option is set to 1, an existing
5307-
path entry is moved to the beginning respective end unless duplicates
5308-
are allowed. This is the default behavior of Lmod.
5296+
This environment variable changes the behavior of :mfcmd:`prepend-path`, :mfcmd:`append-path` and :subcmd:`use`.
5297+
5298+
If set to 1, and one of these commands targets a path entry that already exists in the environment variable, the entry is moved to the beginning or end (depending on the command), unless duplicates are allowed. This is the default behavior in Lmod.
5299+
If set to 0, the environment variable is not modified when the entry already exists.
5300+
5301+
Example:
5302+
5303+
.. parsed-literal::
5304+
5305+
:ps:`$` module config path_entry_reorder 0
5306+
:ps:`$` module append-path PATHVAR /foo
5307+
:ps:`$` module append-path PATHVAR /bar
5308+
:ps:`$` module append-path PATHVAR /foo
5309+
:ps:`$` echo $PATHVAR
5310+
/foo:/bar
5311+
:ps:`$` module config path_entry_reorder 1
5312+
:ps:`$` module append-path PATHVAR /foo
5313+
:ps:`$` echo $PATHVAR
5314+
/bar:/foo
5315+
:ps:`$` module append-path --duplicates PATHVAR /bar
5316+
:ps:`$` echo $PATHVAR
5317+
/bar:/foo:/bar
53095318
53105319
.. only:: html
53115320

0 commit comments

Comments
 (0)