Commit Graph

282 Commits

Author SHA1 Message Date
Xavier Delaruelle
664808acd7 install: swap --enable-dotmodulespath/--enable-modulespath
Make --enable-modulespath the primary option name and
--enable-dotmodulespath the secondary option name as .modulespath is not
anymore the primary name of this configuration file.
2021-07-18 22:06:02 +02:00
Xavier Delaruelle
6050cb7216 install: set --enable-set-shell-startup off by default
Installation option '--enable-set-shell-startup' is set off by default
but could be enabled once installed through the `initrc` configuration
file.

It seems better to let people choose to enable this option than being
surprised to find Modules initialization script run automatically each
time a sub-shell is spawn.
2021-07-16 22:04:27 +02:00
Xavier Delaruelle
35e559764e Inhibit rcexpandparam Zsh option when initializing
Protect quarantine mechanism code from 'rcexpandparam' Zsh option when
initializing the module command on this shell.

Fixes #403
2021-07-13 13:31:31 +02:00
Xavier Delaruelle
e26a2d86cf init: update stderr redirection in fish init script
Use of '^' character to redirect stderr has been deprecated starting
Fish version 3.1. It now produces an error. Stderr should be redirected
with '2>' like on SH shells. Hopefully '2>' redirection is also
supported on old Fish versions (all version 2 support it).

This update was performed on modulecmd.tcl with 711c901 commit, but fish
initialization script was forgotten at that time.
2021-07-04 20:56:45 +02:00
Xavier Delaruelle
e11acd3fcb init: add try-load sub-cmd to completion scripts 2021-06-30 21:54:06 +02:00
Xavier Delaruelle
09aec34876 init: add edit sub-cmd to completion scripts 2021-06-30 21:48:49 +02:00
Xavier Delaruelle
20a7015a41 init: add variant_shortcut config to completion script 2021-06-28 20:44:23 +02:00
Xavier Delaruelle
95296fd75e init: add editor config to completion script 2021-04-24 13:36:51 +02:00
Anais GAERTNER
36b32fc24f init: add -w/--width options to completion scripts 2021-02-18 09:45:58 +01:00
Anais GAERTNER
e3548dc5d7 init: add term_width config to completion script 2021-02-18 09:45:58 +01:00
Xavier Delaruelle
b41655eb30 install: silently include version.inc in Makefiles
Silently include version.inc in main, doc and init Makefiles to avoid
'Makefile:349: version.inc: No such file or directory' warning message
when version.inc needs to be rebuilt prior being loaded.
2021-02-17 16:04:04 +01:00
Xavier Delaruelle
7518083803 install: no include of version.inc for 'clean' make goals 2021-02-17 16:04:04 +01:00
Xavier Delaruelle
d3b45ff648 install: build ../version.inc from init/doc Makefiles
Add makefile rule to build ../version.inc file if missing from the init
and doc Makefiles.
2021-02-17 16:04:04 +01:00
Xavier Delaruelle
94df593f4a install: pretty print on makefile build targets
Print generated file names rather commands executed to generate these
files on makefile build targets. Output when making Modules is this way
simplified. When option `V=1` is passed to make verbose mode is enabled
and executed commands are shown.

Simplified make output does not apply to the install, uninstall, test,
clean, distclean targets and their relatives.
2021-02-17 16:04:03 +01:00
Xavier Delaruelle
5115e42fad init: add completion of -a/--all opt on list sub-cmd 2021-02-09 06:29:48 +01:00
Xavier Delaruelle
b885eb2c4c init: add -o/--output options to completion scripts 2021-02-09 06:26:09 +01:00
Xavier Delaruelle
3c8746d264 init: use -o option instead of sed in completion scripts
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.
2021-02-09 05:58:59 +01:00
Xavier Delaruelle
dba0bb2f0c init: add {avail,list}_*output configs to completion scripts 2021-02-08 07:17:37 +01:00
Colin Marquardt
d6ae38c91c init: replace completion helper vars with their content
This is done for tcsh and bash where those variables clutter the
environment.

Closes #382
2021-02-04 07:04:45 +01:00
Xavier Delaruelle
13b8cfaf6b init: add mcookie_version_check config to completion scripts 2021-01-25 06:08:21 +01:00
Xavier Delaruelle
2ce5b8ae17 init: add tag_color_name config to completion scripts 2020-12-18 18:58:53 +01:00
Xavier Delaruelle
0aba0b4437 init: add tag_abbrev config to completion scripts 2020-12-18 18:58:37 +01:00
Xavier Delaruelle
faa81ad5d4 init: add implicit_requirement config to completion scripts 2020-11-15 10:03:42 +01:00
Xavier Delaruelle
995977b5f1 init: add shells_with_ksh_fpath config to completion scripts 2020-11-15 10:03:42 +01:00
Xavier Delaruelle
5f16765b47 Define FPATH during autoinit for ksh shell
When initializing module on ksh shell with the autoinit sub-command, add
to the FPATH environment variable the directory where module function is
defined. Which helps to get module function defined in ksh interactive
and non-interactive sub-shells.

This FPATH setup for ksh shell was previously done in ksh initialization
script.
2020-11-15 10:03:31 +01:00
Xavier Delaruelle
fb8b8a2f0b init: add nearly_forbidden_days config in completion scripts 2020-08-28 07:18:25 +02:00
Xavier Delaruelle
a8529c05e5 init: add -a/--all option to completion scripts 2020-08-11 07:02:18 +02:00
Xavier Delaruelle
bc1373dffc init: add -T/--trace options to completion scripts 2020-06-01 21:02:32 +02:00
Xavier Delaruelle
9d5517d202 init: fix dup apropos/keyword/search in bash comp
apropos, keyword and search sub-commands now accept arguments so they
need to be removed from empty-or-wide-argument-command list
2020-06-01 20:59:50 +02:00
Xavier Delaruelle
80e7033ba2 init: add 'sh-to-mod' sub-cmd to shell comp scripts 2020-06-01 20:59:50 +02:00
Xavier Delaruelle
c5fd2df8b5 init: fix list/source sub-cmd in fish completion
list and source sub-commands do not need available modulefiles as
argument.
2020-06-01 20:59:50 +02:00
Adrien Cotte
ad82a9125f bash_completion: fix ml no space between -modules 2020-04-04 16:54:38 +02:00
Xavier Delaruelle
711c90104f Update stderr redirection for new Fish shell versions
Use of '^' character to redirect stderr has been deprecated starting
Fish version 3.1. It now produces an error. Stderr should be redirected
with '2>' like on SH shells. Hopefully '2>' redirection is also
supported on old Fish versions (all version 2 support it).

Fixes #325
2020-03-19 05:29:08 +01:00
Xavier Delaruelle
05451a831f init: define ml completion only if ml command defined 2020-03-14 10:41:03 +01:00
Adrien Cotte
f16c0d8a0f init: add 'ml' command support in bash completion 2020-03-14 10:41:03 +01:00
Xavier Delaruelle
37b46a3778 init: use 'sed -r' if 'sed -E' not supported
`-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
2020-02-22 13:04:04 +01:00
Xavier Delaruelle
5aac870aa5 init: fix bash completion script for Bash <4.0
`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
2020-02-22 09:41:54 +01:00
Xavier Delaruelle
d6362eef3d script/init: quote path variables in win-specific scripts
To handle installation path containing whitespaces like "C:\Program
Files\Environment Modules".
2020-01-17 21:39:22 +01:00
Xavier Delaruelle
089a680263 install: add dist-win rule to build win-specific dist zip ball 2020-01-17 21:39:22 +01:00
Xavier Delaruelle
a5f3e842f9 init: simplify cmd init file
Always define Modules-specific environment variables when running `cmd`
initialization file.
2020-01-14 06:13:30 +01:00
Xavier Delaruelle
2d64c275f6 init: move windows/moduleinit.cmd as init/cmd.cmd file 2020-01-14 06:13:30 +01:00
Xavier Delaruelle
58212613ed init: add -j/--json options to completion scripts 2020-01-09 20:59:31 +01:00
Xavier Delaruelle
4919ae356e init: ensure ml is defined in bash/ksh subshells 2020-01-09 20:38:50 +01:00
Xavier Delaruelle
9f189c7d5e Introduce ml configuration option
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.
2020-01-09 20:38:50 +01:00
Xavier Delaruelle
d5126ae296 init: fix missing -i/--icase in completion scripts 2019-11-14 20:22:45 +01:00
Xavier Delaruelle
a386dbb67c Introduce home configuration option
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
2019-11-14 20:22:45 +01:00
Xavier Delaruelle
07bbbc7a9d Introduce advanced_version_spec configuration option
Add the advanced_version_spec configuration option that will control the
activation of advanced module version specifier syntax.
2019-11-14 20:20:40 +01:00
Xavier Delaruelle
e67088275e Introduce extended_default configuration option
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.
2019-11-11 09:13:50 +01:00
Xavier Delaruelle
35ba37b76a init: add 'icase' option to completion scripts 2019-11-11 09:00:03 +01:00
Xavier Delaruelle
58b8f73dee Workaround for Tcsh history issue with wa_277 conf opt
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.
2019-09-16 20:34:51 +02:00