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 'append-path', set the variable passed to
'remove-path' procedure in ::env() array to make accurate value
available for later use during the modulefile evaluation.
As a side effect as remove-path command is now evaluated on help, test,
display and whatis modes, invalid argument on this command will raise
error. Previously arguments were not parsed so no error raised.
Add 50-cmds/069-remove-env test 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
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.