Implement 'stashlist' sub-command. Rely on cmdModuleSavelist but adapt
this procedure to make several behavior changes when called by
cmdModuleStashlist:
* elements are sorted in reverse order
* element index starts at 0
* when no collection target set, only return collection without a target
set
Introduce stashlist sub-command to list stash collection file.
This sub-command cannot be called from a modulefile evaluation context.
Add sub-command empty skeleton: cmdModuleStashlist.
Sub-command accepts no argument. It accepts --terse, --long and --json
options.
Implement 'stashclear' sub-command. Fetch all existing stash collection
for current collection target. Then call 'saverm' sub-command over all
of these collection obtained.
Introduce stashclear sub-command to delete all stash collection file.
This sub-command cannot be called from a modulefile evaluation context.
Add sub-command empty skeleton: cmdModuleStashclear.
Sub-command accepts no argument nor option.
Introduce stashshow sub-command to display stash collection file.
This sub-command cannot be called from a modulefile evaluation context.
Add sub-command empty skeleton: cmdModuleStashshow.
Sub-command accepts no option. It may take an optional argument: the
index of the stash collection to display or the name of the stash
collection. If no argument is provided, stash collection 0 is assumed.
Introduce stashrm sub-command to delete stash collection file.
This sub-command cannot be called from a modulefile evaluation context.
Add sub-command empty skeleton: cmdModuleStashrm.
Sub-command accepts no option. It may take an optional argument: the
index of the stash collection to delete or the name of the stash
collection. If no argument is provided, stash collection 0 is assumed.
Implement 'stashpop' sub-command. First parse stash argument to
determine corresponding stash collection name or raise an error if stash
value is invalid. Then restore stash collection. Afterward delete stash
collection.
Add no_other_target option to findCollections procedure to filter when
glob searching the result from other target. Especially useful when
collections for specific targets exist but no target is currently set in
user environment.
This no_other_target is disabled by default. savelist sub-command
currently returns other targets when no target is set. But the option
will be enabled for stashpop, to ensure that the popped collection is
from the current target or from the *no target* if none set.