Skip to content

Commit

Permalink
mode takes an array not a single value
Browse files Browse the repository at this point in the history
  • Loading branch information
Robert McLay committed Jan 17, 2025
1 parent 976a7b7 commit 6be8967
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions docs/source/370_irreversible.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@ Mode select is implemented through a table with a ``mode`` field that specifies
setenv{
name = "MY_VAR",
value = "some_value",
mode = "load"
mode = {"load"}
}

-- Execute only during unload
setenv{
name = "CLEANUP_VAR",
value = "cleanup_value",
mode = "unload"
mode = {"unload"}
}

Supported Modes
Expand All @@ -40,8 +40,8 @@ Important Notes

1. When using mode select, the specified action becomes irreversible in the opposite mode. For example:

* If an action is specified with ``mode = "load"``, it will not be automatically reversed during unload
* If an action is specified with ``mode = "unload"``, it will not be automatically reversed during load
* If an action is specified with ``mode = {"load"}``, it will not be automatically reversed during unload
* If an action is specified with ``mode = {"unload"}``, it will not be automatically reversed during load

2. To completely remove the effects of a mode-specific module, you may need to:

Expand All @@ -67,7 +67,7 @@ Consider a module that needs to perform special cleanup during unload::
setenv{
name = "CLEANUP_REQUIRED",
value = "true",
mode = "unload"
mode = {"unload"}
}

In this example:
Expand All @@ -83,4 +83,4 @@ Best Practices
2. Document any irreversible changes in the module's help text
3. Consider providing helper functions or instructions for users to manually reverse changes
4. Test both load and unload scenarios thoroughly
5. Consider the impact on module collections and module restore operations
5. Consider the impact on module collections and module restore operations

0 comments on commit 6be8967

Please sign in to comment.