Fix argument parsing for the `append-path`, `prepend-path` and
`remove-path` modulefile commands to consider every arguments found
after the variable name as variable values and not command option even
if argument starts with `-` character.
Fixes#278.
Like previously done for 'setenv', set the variable passed to
'append-path' and 'prepend-path' procedures in ::env() array to make it
available for later use during the modulefile evaluation.
As a side effect as append-path/prepend-path commands are now evaluated
on help, test, display and whatis modes, invalid argument on these
commands will raise error. Previously arguments were not parsed so no
error raised.
Add 50-cmds/049-append-env and 50-cmds/059-prepend-env tests to check
this ::env() array change over all evaluation mode. Adapt
50-cmds/350-allin to check this change against 'whatis' mode.
Remove path entry in environment variable by passing an index rather a
string. String at specified index in content list is removed if coherent
with relative reference counter.
Let the possibility to append or prepend path element entry to a
variable even if this entry is already registered into the variable
which introduces duplicates element within the variable value.
Entries are added with eventual duplication by the use of the
--duplicate option on append-path and prepend-path commands. These
additions increment the reference counter as usual.
Removal of duplicated path entry depends on the reference counter value.
Entries are not removed unless reference counter value is lesser than
the number of duplicated entries.
Enable append-path, prepend-path and remove-path to receive multiple
path value arguments.
Add some non-regression tests for modulefile or sub-command cases.
Update modulefile.4 and module.1 docs.
Closes#141
Detect if path string passed to append-path, prepend-path or remove-path
commands is composed of multiple path entries (separated by specified or
default delimiter string). In this situation add/remove each path
separately to correctly update relative reference counter.
Add some non-regression tests for modulefile or sub-command cases.
Update modulefile.4 doc.
Closes#142
Detect missing environment variable name or value when calling
append-path, prepend-path or remove-path procedures. Raise error in this
situation.
Introduce a 'parsePathCommandArgs' to check args for the 3 *-path
commands.
Add non-regression tests in 050-cmds and 070-maint suites to check bad
argument situations.
Closes#139
On a 'module switch [mod1] mod2', If 'mod1' is not specified, then it is
assumed to be the currently loaded module with the same root name as
'mod2'.
Introduce a 'getLoadedWithClosestName' procedure to look at currently
loaded modules and return the one with the closest name to the name
passed as argument.
Import and adapt 170-swap, 172-swap-app-delim, 173-swap-app-delim,
175-swap2, 177-swap-prep-delim and 178-swap-prep-delim tests to the
50-cmds suite.
fly, as it were. It's a powerful mechanism for dynamically changing
environment variables, aliases, X11 resources, etc.
It uses an embedded Tcl intrepretor, with a few extensions. Therefore,
it has a well defined language syntax.
Version 3.1 is GPL, and includes many improvements over the 3.0beta.