Update the ENVIRONMENT section in module(1) man page to provide for each
Modules environment variable the name of the configuration option that
could be used to set the variable through the config sub-command.
Update the environment analysis made for sh-to-mod sub-command and
source-sh modulefile command for fish shell to include the private
functions. Catch this way all definition that may be used to set shell
completion.
Alias definition may sometimes be enclosed in parenthesis on csh shell.
Fix alias parsing regexp to support such definition.
Useful for Conda initialization script for csh shell: conda shell alias
definition is presented by csh shell enclosed in parenthesis.
Fixes#434.
Remove entirely the work on the noglob_eval_shells option as enclosing
in quotes the generated output of modulecmd.tcl to pass it to the eval
command is equivalent to disable the pathname expansion mechanism of
sh-kind shells.
As the module shell function code is currently updated for sh-kind
shells, take this opportunity to translate the `cmd` execution syntax
into the more modern $(cmd) syntax.
Update the module shell function definition for sh-kind shell to enclose
the output generated by modulecmd.tcl in quotes in order to pass it to
the eval command.
Quoting code to pass it to eval brings correctness to the definition of
shell functions without harming already well functionning definition.
Regular shell function definition could now be correctly defined in user
environment: no more need to get each command line in these function
ending with a ';' character.
Same mechanism was applied in initialization script to evaluate the code
produced by the autoinit sub-command.
Multiple function-definition issues spotted when using source-sh across
environment setting script shell are fixed with this change.
Moreover, all the noglob_eval_shells work is made useless with this
change as no globbing is applyed to the code produced by modulecmd.tcl
as it is now enclosed in quotes.
Update execShAndGetEnv to correctly escape the '[' and '|' characters in
fish shell code to filter builtin commands. These character were not
correctly escaped previously (replaced by '$1').
Fix the fish code to withdraw builtin functions to compare functions
defined before and after fish script shell execution in execShAndGetEnv
procedure.
Previous regexp was not matching the full string, so every function
whose name contained a substring equal to the name of a builtin function
(like '_') where filtered.
On fish shell, function definition can be embedded inside function
definition. Update the execShAndGetEnv procedure to add a string
separated after each function definition (%ModulesSubShToMod%) to
clearly delimitate the shell function to analyse and report and skip the
definition of nested functions.
Add code in module shell function (for shells listed in
noglob_eval_shells) to disable pathname expansion for the time of
produced shell code evaluation.