@@ -262,6 +262,81 @@ other value corresponds to the name of a collection to restore.
262262 Unloading bar/1.0
263263 Unloading foo/1.0
264264
265+ Stashing environment
266+ --------------------
267+
268+ The ability to stash current environment is added with the introduction of the
269+ :subcmd: `stash ` sub-command. When called current environment is saved in a
270+ *stash * collection then initial environment is restored.
271+
272+ .. parsed-literal ::
273+
274+ :ps: `$ ` module list
275+ Currently Loaded Modulefiles:
276+ 1) bar/2.0 2) foo/2.0
277+ :ps: `$ ` module stash
278+ Unloading :sgrhi: `foo/2.0 `
279+ Unloading :sgrhi: `bar/2.0 `
280+ :ps: `$ ` module list
281+ No Modulefiles Currently Loaded.
282+
283+ Sub-commands are added to specifically handle stash collections. Their names
284+ are prefixed with *stash *, like :subcmd: `stashlist ` to list existing stash
285+ collections or :subcmd: `stashshow ` to display their content.
286+
287+ .. parsed-literal ::
288+
289+ :ps: `$ ` module stashlist
290+ Stash collection list:
291+ 0) stash-1665377597432 1) stash-1664946764252
292+ :ps: `$ ` module stashshow
293+ -------------------------------------------------------------------
294+ :sgrhi: `/home/user/.module/stash-1665377597432: `
295+
296+ :sgrcm: `module ` use --append /path/to/modulefiles
297+ :sgrcm: `module ` load bar
298+ :sgrcm: `module ` load foo
299+
300+ -------------------------------------------------------------------
301+
302+ Stash collections can be designated on sub-commands by their collection name
303+ or stash index. Most recent stash collection has index ``0 ``, the one after is
304+ designated with index ``1 ``, and so on. When no stash collection is specified,
305+ most recent one is assumed.
306+
307+ .. parsed-literal ::
308+
309+ :ps: `$ ` module stashshow 1
310+ -------------------------------------------------------------------
311+ :sgrhi: `/home/user/.module/stash-1664946764252: `
312+
313+ :sgrcm: `module ` use --append /path/to/modulefiles
314+ :sgrcm: `module ` load foobar
315+
316+ -------------------------------------------------------------------
317+
318+ Stash collections are restored with the :subcmd: `stashpop ` sub-command. It
319+ changes the user environment to match the stash definition, then it deletes
320+ the stash collection file.
321+
322+ .. parsed-literal ::
323+
324+ :ps: `$ ` module stashpop
325+ Loading :sgrhi: `bar/2.0 `
326+ Loading :sgrhi: `foo/2.0 `
327+ :ps: `$ ` module stashlist
328+ Stash collection list:
329+ 0) stash-1664946764252
330+
331+ Stash collections can be deleted one by one with :subcmd: `stashrm ` sub-command
332+ or all together with :subcmd: `stashclear `.
333+
334+ .. parsed-literal ::
335+
336+ :ps: `$ ` module stashrm
337+ :ps: `$ ` module stashlist
338+ No stash collection.
339+
265340
266341 v5.1
267342====
0 commit comments