Files
modules/testsuite/modulefiles/puts/5
Xavier Delaruelle 7522b09bf2 Spool puts stdout command to render after env changes
Supersede 'puts' command to catch content sent to stdout within
modulefile in order to postpone content channel send after rendering on
stdout the relative environment changes required by the modulefile.

By doing so, environment variable set within modulefile will be
available when outputing directly command to the stdout channel.

A 'putsModfileCmd' procedure is added to catch all 'puts' call in a
modulefile interpretation. This procedure analyzes if the puts command
targets the stdout channel. If so, command argument is saved in a
'g_stdoutPuts' global list to be then processed during renderSettings.
If no, the real puts is called (for stderr send for instance).

Add 50-cmds/310-puts non-regression tests to garanty all kind of puts
command are well processed.

Closes #113
2017-11-23 06:51:54 +01:00

32 lines
694 B
Plaintext

#%Module1.0
##############################################################################
# Modules Revision 3.0
# Providing a flexible user environment
#
# File: puts/%M%
# Revision: %I%
# First Edition: 2017/11/23
# Last Mod.: %U%, %G%
#
# Authors: Xavier Delaruelle, xavier.delaruelle@cea.fr
#
# Description: Testuite modulefile
# Command:
# Sub-Command: puts
#
# Invocation: load @M@
# Result: %R{
# }R%
# Comment: %C{
# Check the 'puts' command
# }C%
#
##############################################################################
if {[module-info mode "load"] || [module-info mode "display"]} {
puts -nonewline foo bar
}
setenv testsuite ok