Update shell completion scripts to make use of the module option -o to
control the element to find in output rather using sed command to discard
the unwanted elements.
`-E` option is a *relatively* recent option of GNU sed (v4.2), yet
mandatory for OS portability (as detailled in b68e44e).
Adapt configure step to detect if sed option `-E` is supported and
fallback to `-r` otherwise.
Fixes#317
`compopt` Bash builtin has been introduced in Bash 4.0, so using it on
Bash <4.0 prints error messages. To fix this, `comptopt` availability is
checked prior usage. If not available, the no-space-append behavior will
not be obtained which will not be an optimal situation if the
`no-indepth` mode is set for the `avail` sub-command.
Fixes#318
Add the ability to control whether or not a ``ml`` command should be
defined at Modules initialization time. `ml` is a handy frontend to the
module command: it reduces the number of characters to type to trigger
module.
Enablement is managed throught a new configuration option named `ml`
(which defines `MODULES_ML` environment variable when set). It may be
enabled by default in `modulecmd.tcl` script with option `--enable-ml`
passed to `./configure` script.
Make MODULESHOME environment variable controllable through the `config`
sub-command with `home` configuration option. A `--with-moduleshome`
argument is also added to the ./configure script to set specific default
value for this option at installation time.
Fixes#292
Add the ability to select a module when its version is partially
specified. Enable this behavior through a new configuration option named
`extended_default` (which defines `MODULES_EXTENDED_DEFAULT` environment
variable when set).
When extended_default mechanism is enabled a module version may be
specified by its starting portion, part separated from the rest of the
version string by a `.` or `-` character.
When multiple versions match partial version specified and only one
module should be returned, default version (implicit or explicit) among
matches is returned. In case `implicit_default` is disabled and no
explicit default is found among matches, an error is returned.
Mechanism may be enabled by default in `modulecmd.tcl` script with
option `--enable-extended-default` passed to `./configure` script.
Introduce the wa_277 configuration option to workaround an issue with Tcsh
history described on ticket #277.
When option is enabled (which sets the MODULES_WA_277 environment variable
to 1), an alternative module alias is defined which fixes the history
mechanism issue. However the alternative definition of the module alias
weakens shell evaluation of the code produced by modulefiles. Characters
with special meaning for Tcsh shell (like { and }) may not be used
anymore in shell alias definition elsewhere the evaluation of the code
produced by modulefiles will return a syntax error.
Fixes#277.
Reintroduce the ``verbose`` verbosity level and associated ``--verbose``
and ``-v`` command-line switches, which were available on Modules v3.
Verbose mode adds additional informational messages, like a systematic
report of the loading or unloading module evaluations. The ``module``
command could be set verbose by default at ``./configure`` time with
``--with-verbosity`` option. ``MODULES_VERBOSITY`` environment
variable supersedes this setting and it could be set with ``config``
module sub-command through the ``verbosity`` option.
Reintroduce the ``silent`` verbosity level and associated ``--silent``
and ``-s`` command-line switches, which were available on Modules v3.
Silent mode turns off error, warning and informational messages. The
``module`` command could be set silent by default at ``./configure``
time with ``--with-verbosity`` option. ``MODULES_VERBOSITY`` environment
variable supersedes this setting and it could be set with ``config``
module sub-command through the ``verbosity`` option.
Add a ``verbosity`` configuration option to define the default message
verbosity level (between a ``normal`` and a ``debug`` level). This
option could be set at ``./configure`` time with ``--with-verbosity``
option. It could be superseded with the ``MODULES_VERBOSITY``
environment variable, that could be set with ``config`` module
sub-command through the ``verbosity`` option.
Defining a ``debug`` verbosity level at the command-line level is still
achieved by using the ``-D`` or ``--debug`` command-line switches.
Introduce the ability not to set the shell startup file that ensure
``module`` command is defined once shell has been initialized. Setting
shell startup file currently means defining ``ENV`` and ``BASH_ENV``
environment variable to the Modules bourne shell initialization script.
``./configure`` options ``--enable-set-shell-startup`` and
``--disable-set-shell-startup`` define if shell startup should be set or
not by default. It could be superseded with the
``MODULES_SET_SHELL_STARTUP`` environment variable, that could be set
with ``config`` module sub-command through the ``set_shell_startup``
option.
Introduce the ability to control the module search match. Search query
string should match module name start or any part of module fully
qualified name. Default search match behavior is set at ``./configure``
time with the ``--with-search-match`` option. It could be superseded
with the ``MODULES_SEARCH_MATCH`` environment variable, that could be
set with ``config`` module sub-command through the ``search_match``
option. Command-line switches ``--starts-with`` (``-S``) and
``--contains`` (``-C``) for ``avail`` module sub-command enable to
supersede defined search match configuration.
Add to the configure script the --with-locked-configs option to ignore
environment variable superseding of Modules configurations defined in
modulecmd.tcl script. Lockable configuration option are extra_siteconfig.
Currently locked options are reported through the locked_configs option
on the config sub-command.
This new configure option replces --enable-extra-siteconfig which was
dedicated to the control over the MODULES_SITECONFIG variable.
Add the ability to configure whether an implicit default version should
be defined for modules with no default version explicitly defined. When
enabled, which stays the default behavior, a module version is
automatically selected (latest one) when the generic name of the module
is passed. When implicit default selection is disabled, the name of
modules to evaluate should be fully qualified elsewhere an error is
returned. This option is set at `./configure` time with the
`--enable-implicit-default` and `--disable-implicit-default` options. It
could be superseded with the `MODULES_IMPLICIT_DEFAULT` environment
variable, that could be set with `config` module sub-command throught the
`implicit_default` option.
When implicit_default is disabled:
- module implicit default versions are excluded from 'module avail -d'
results.
- false is returned when argument passed to the 'is-avail' sub-command
is a directory without an explicit default set in it.
- and auto_handling is enabled, the requirement load mechanism will fail
on requirement relying on module implicit default version
Fixes#179.
Add the ability to configure when unloading a module and multiple loaded
modules match request if firstly loaded module should be choosen or
lastly loaded module. Default behavior is set at the `./configure` time
with the `--with-unload-match-order` switch. This default could be
superseded with the `MODULES_UNLOAD_MATCH_ORDER` environment variable,
that could be set with `config` module sub-command throught the
`unload_match_order` option.
This change allows to restore behavior of Modules compatibility version
where first matching module in loaded module list were unloaded in such
situation.
By default, lastly loaded module is set for unload (like it was
before this change) to limit impact on the loaded module list when
dependencies are woven between these loaded modules.
Even if this change enables to change the default behavior, it is highly
recommanded to keep it as soon your modulefiles express dependencies
between each other.
Fixes#198.
Add to the configure script the `--enable-extra-siteconfig` and
`--disable-extra-siteconfig` options to allow or forbid the definition
of a site-specific configuration script controlled with the
`MODULES_SITECONFIG` environment variable.
These options control the default value of the `g_extrasiteconfig`
variable in `modulecmd.tcl`. If this variable is true (by default),
MODULES_SITECONFIG is looked at the siteconfig sourcing time. Thus the
primary siteconfig.tcl can set the variable to false to ensure the
extra siteconfig is disabled whatever the option passed at ./configure
time.
With same behavior than on compatibility version. The list of the
environmet variables that are cleared by this sub-command has been
updated to match the recent development (MODULES_LMPREREQ, ...)
Fixes#203.