Commit Graph

40 Commits

Author SHA1 Message Date
Xavier Delaruelle
9cec56c027 Revise alias and symbolic version internal registering
Register alias and symbolic version deep resolution at definition time
through a new 'setModuleResolution' procedure called by 'module-version'
and 'module-alias' procedures. Make use of new global array
'g_moduleResolved' and its reverse structure 'g_resolvedHash' to keep
registered resolution at hand. Also introduce 'g_symbolHash' global
array to register and easily get the list of all symbols for a given
module.

As resolution is now computed at definition time, the 'getVersAliasList'
and 'resolveModuleVersionOrAlias' procedures can be greatly simplified
and just need to return the value of the 'g_symbolHash' or
'g_moduleResolved' arrays for the module name passed as argument. This
change saves lot of time especially on commands heavily relying on these
procedures like 'avail'.

The global arrays 'g_versionHash', 'g_moduleDefault' and 'g_aliasHash'
become useless with this change so they have been removed.

As a side effect of resolving alias and symbolic version at definition
time, resolution loop are not registered anymore and produce an error
message when spotted.
2017-06-21 06:08:47 +02:00
Xavier Delaruelle
b17785d149 Test and document 'autoinit' module command 2017-05-20 08:55:59 +02:00
Xavier Delaruelle
dc7f186813 Fix, test and document 'paths' module command 2017-05-18 07:18:38 +02:00
Xavier Delaruelle
dbdf3a5e37 Test and document 'path' module command 2017-05-18 06:21:07 +02:00
Xavier Delaruelle
4e27244726 Fix 'init*' commands to behave more like C-version
Adapt tests from 60-initx to match results produced by this module
flavor. Clarify differences with C-version on these module commands in
diff_with_c-version documentation.
2017-05-16 20:17:00 +02:00
Xavier Delaruelle
20093d7218 Introduce 'test' command and mode
Add 'module test' command to trigger when called execution of a
ModulesTest procedure in target modulefile following same kind of
mechanism than 'module help'.

If ModulesTest procedure is missing from modulefile, a 'Unable to find
ModulesTest proc' message is displayed but no error code is set. If
ModulesTest procedure returns 1 (true), test is considered successful and
message 'Test result: PASS' is displayed. If ModulesTest returns no or
any other value, test is considered failed and message 'Test result:
FAIL' is displayed. In this case, module command exit in error.

Adapt bash and tcsh completion scripts for the new command. Describe new
command and new mode in docs.

Adapt existing non-regression tests and relative test modulefiles for
new command and new mode in 00-init, 50-cmds and 70-maint suites. Add
085-test tests in 70-maint to check coherent behavior of new command.
2017-04-30 19:00:18 +02:00
Xavier Delaruelle
27abb7e431 Release of version 1.832 2017-04-29 08:23:22 +02:00
Xavier Delaruelle
acadbf0d8f doc: clarify mgmt of file access issue 2017-04-27 06:21:26 +02:00
Xavier Delaruelle
d3372d2abd doc: load in modfile unload in reserve order 2017-04-27 06:19:41 +02:00
Xavier Delaruelle
fbe7326c4e doc: clarify version/alias handling in avail and loc 2017-04-26 06:12:27 +02:00
Xavier Delaruelle
346593585b doc: add tcl specific stuff to diff_with_c-version
Improve diff_with_c-version document to describe the features of the
Tcl-version that are not supported on the C-version.

Also state that the diff takes C version 3.2.10 against Tcl version
1.729 as a basis. Differences appearing past these versions will be
flagged with the release number of appearance.
2017-03-06 06:09:15 +01:00
Xavier Delaruelle
a8207ff45f install: add modulefilesdir configuration option
@modulefilesdir@ enables to set the default system-wide modulefiles
directory as described in module.1 man page.
2017-03-06 06:09:14 +01:00
Xavier Delaruelle
1c9b4bdc2c doc: adapt module doc to path used for install
Use same process than init scripts to translate module documentation
from configure-like pattern (@prefix@, @initdir@, etc) to the path name
chosen for installation.
2017-03-06 05:37:49 +01:00
Xavier Delaruelle
faa97c3b5f doc: fix python init example for python3 compat 2017-03-05 09:21:59 +01:00
Xavier Delaruelle
ac91e63b23 doc: Describe collection stuff 2017-02-02 06:41:27 +01:00
Xavier Delaruelle
6fd30568f4 doc: Introduce diff_with_c-version.pod document 2017-02-02 06:41:27 +01:00
Xavier Delaruelle
7b16ca6bd0 doc: use itemized-list for ENV and FILES sections
Adapt module.pod and modulefile.pod to use itemized-list rather than
head2 for the content of their ENVIRONMENT and FILES sections. HTML
rendering is clearer with a list than h2.
2017-02-02 06:41:27 +01:00
Xavier Delaruelle
344e386d06 Add module-info mode check against 'remove' and switch' value
For compatibility with C-version, enable to check current 'module-info
mode' against the 'remove' and 'switch' value. To achieve this change
'remove' is considered an alias of the 'unload' value. 'switch' is
checked against the current 'module-info command'.

084-info-mode-exp tests of 50-cmds suite have been adapted. In addition
020-unload and 022-unload2 tests of 95-version suite have also been
adapted as the modulefiles they check are using a 'module-info mode
remove' test.
2017-02-02 06:41:18 +01:00
Xavier Delaruelle
df5b995726 Introduce 'module-info command'
Introduce g_commandNameStack variable, currentCommandName,
pushCommandName and popCommandName procedures to implement a
'module-info command' that returns the name of the currently running
module command.

This new mechanism enables to distinguish complex 'load' or 'unload'
commands that cannot be determined with 'module-info mode' alone. For
instance a modulefile can now be aware that a 'switch', a 'restore' or
a 'purge' command is currently being run.

Add description of this new command to the modulefile documentation.

Add 282-info-command and 283-info-command-exp tests in 50-cmds and adapt
281-info-modulerc in 50-cmds and 020-savelist in 61-coll.
2017-02-02 06:40:56 +01:00
Xavier Delaruelle
7de52996a9 doc: add missing 'aliases' and 'source' sub-commands 2017-02-02 06:40:45 +01:00
Xavier Delaruelle
f1548bbb60 doc: add missing 'search' module sub-command 2017-01-24 07:27:50 +01:00
Xavier Delaruelle
c826257a39 Add arg to test current {shell,shelltype}' in module-info
Add the possibility to pass a string to 'module-info shell' and
'module-info shelltype' to get a boolean test on currently used shell or
shelltype. This kind of behavior is already available on 'module-info
mode' to test module current mode.

These features are supported by C-version even if not documented.

modulefile documentation and 087-info-shells-exp tests in 50-cmds suite
have been adapted accordingly.
2017-01-20 15:27:32 -06:00
Xavier Delaruelle
5c760947b8 doc: clarify 'module-info {symbols,version}' commands 2017-01-20 15:27:26 -06:00
Xavier Delaruelle
dbe54e6ae4 doc: adapt descrition of 'x-resource' 2017-01-20 15:27:01 -06:00
Xavier Delaruelle
efff24d2e5 doc: adapt calls used by 'system' and 'uname' 2017-01-20 15:26:56 -06:00
Xavier Delaruelle
dd65659241 doc: adapt list of mode returned by 'module-info mode' 2017-01-20 15:26:50 -06:00
Xavier Delaruelle
272e1c2c02 doc: add refresh alias on reload sub-command 2017-01-20 15:26:44 -06:00
Xavier Delaruelle
6fa75982e8 doc: case when MODULERCFILE points to a directory 2017-01-20 15:26:38 -06:00
Xavier Delaruelle
9f82703511 doc: add --default and --latest avail switches 2017-01-20 15:26:32 -06:00
Xavier Delaruelle
f2c8325e99 doc: add --help, --version and --debug switches 2017-01-20 15:26:25 -06:00
Xavier Delaruelle
ac797a6495 doc: switch command accepts only one argument 2017-01-20 15:26:19 -06:00
Xavier Delaruelle
63540736ee doc: reference newly supported shells (fish, tcl, lisp) 2017-01-20 15:25:24 -06:00
Xavier Delaruelle
d0fe603621 doc: improve docs readability
Adopt and apply writing conventions found especially in man-manpages(7)
to improve documents readability:

* always refer to 'modulefile' or 'modulefiles' with I<> pod code
* refer to other manpages with B<> pod code
* refer to filename or pathname with F<> pod code
* refer to environment variable with B<> pod code
* no '$' before environment variable except if its value is referred
* no escaping '{}' of environment variable
* use item list to describe ordered list
* use item list to describe all command-line switches, all module
  sub-commands and all modules-specific Tcl commands
* refer to command-line switches, module sub-commands, modules-specific
  Tcl commands, Modules variables and Modules subroutines with B<> pod
  code
* use normal font for arguments on item list
* refer to arguments of current command-line switch, module sub-command
  or modules-specific Tcl command with I<> pod code
* express 1+ arguments with a 'arg...' syntax
* format pod source with 'fmt' to set maximum line witdh to 78 chars
* fix double spaces '  ' or end of line extra space found in paragraphs
2017-01-20 15:25:06 -06:00
Xavier Delaruelle
e5afef5725 doc: remove stuff specific to C-version
Changes made on module.pl:
* remove text related to the 'modulesbeginenv' feature
* remove 'clear' sub-command
* change 'update' sub-command into 'reload and adapt description

Changes made on modulefile.pl:
* remove 'module-info flags' modules-specific Tcl command
* remove 'module-trace' modules-specific Tcl command
* remove 'module-user' modules-specific Tcl command
* remove 'module-log' modules-specific Tcl command
* remove 'module-verbosity' modules-specific Tcl command
2017-01-20 15:25:00 -06:00
Xavier Delaruelle
994e572b2f doc: syntax fixes and import recent changes on C doc 2017-01-20 15:24:46 -06:00
Xavier Delaruelle
eb018d840e doc: use .pod extension for POD documents
This way these files are automatically recognized as POD files and
the appropriate syntax highlight mode is automatically set.
2017-01-20 15:24:41 -06:00
Kent Mein
e47eff2b73 More doc work. 2014-12-24 05:45:31 -06:00
Kent Mein
4f689da434 Fix some warnings in the documentation from podchecker. 2014-11-12 15:50:48 -06:00
Kent Mein
559f092828 Some work on documentation. 2014-07-16 15:14:39 -05:00
Kent Mein
58e6b8d6c7 Create source docs for man pages.
This is still a work in progress, but I've converted the current
man pages over to pod (perl documentation format)
The idea being that it's easier to edit and can be converted to
various formats.  The manpages are very out of date, but this at least
will encourage me to keep them upto date and make it much easier to
work with.
2014-06-03 16:28:10 -05:00