Commit Graph

363 Commits

Author SHA1 Message Date
Xavier Delaruelle
805752e943 init: add error_on_multi_load config to completion script 2023-08-17 20:59:35 +02:00
Xavier Delaruelle
82ad9e995d init: add unload_match_order to completion script 2023-07-16 09:03:13 +02:00
Xavier Delaruelle
a39a1c1cef init: add sticky_purge to completion script 2023-07-08 15:12:36 +02:00
Xavier Delaruelle
2dfb6196f2 init: fix completion to report syms and aliases
Fix completion scripts (bash, tcsh, fish and zsh) to report symbolic
versions and aliases among available modules.

Fixes #500.
2023-06-27 08:21:31 +02:00
Xavier Delaruelle
8438ea127d lint: fix SC3045 shellcheck warning 2023-05-19 21:36:11 +02:00
Xavier Delaruelle
818da9a4c4 lint: fix SC2034 shellcheck warning 2023-05-18 20:28:10 +02:00
Xavier Delaruelle
eb95d58356 lint: fix SC2091 shellcheck warning 2023-05-18 18:46:06 +02:00
Xavier Delaruelle
0d2f8be08c init: add ignore_user_rc/--ignore-user-rc to comp script 2023-05-07 10:21:10 +02:00
Xavier Delaruelle
5e89196bd1 init: fix nospace activation in bash completion script
Fix bash shell completion script to be able to complete full name of
available modules.

Fixes #490.
2023-04-14 06:08:41 +02:00
Xavier Delaruelle
7093c8579e init: add cache_expiry_secs config to completion script 2022-12-27 18:43:59 +01:00
Xavier Delaruelle
8bf6dc2a6c init: add cache_buffer_bytes config to completion script 2022-12-27 18:43:58 +01:00
Xavier Delaruelle
c48247d9c8 init: add ignore_cache/--ignore-cache to comp script 2022-12-27 18:43:58 +01:00
Xavier Delaruelle
3b7568043a init: add cacheclear subcmd to completion scripts 2022-11-28 03:58:56 +01:00
Xavier Delaruelle
4ba52095dc init: add cachebuild subcmd to completion scripts 2022-11-12 13:26:30 +01:00
Xavier Delaruelle
39923ad178 Revert "init: setup zsh FPATH through autoinit command"
This reverts commit 59ac24e243.

FPATH variable cannot be handled within autoinit process as this is not
an environment variable. Thus when modulecmd.tcl is executed, it does
not know the current value of FPATH. So if it sets FPATH during
autoinit, previous value of this variable is lost. As a result FPATH
must stay defined in initialization script.
2022-10-16 14:06:11 +02:00
Xavier Delaruelle
c3d06a65e0 init: update completion with stashlist output
Update stashpop, stashrm and stashshow completion definition to use
stashlist output.
2022-10-05 07:59:34 +02:00
Xavier Delaruelle
d20c6228a8 init: add stashlist subcmd to completion scripts 2022-10-02 14:26:28 +02:00
Xavier Delaruelle
0e756ba56e init: add stashclear subcmd to completion scripts 2022-09-29 07:02:38 +02:00
Xavier Delaruelle
8af7d4568f init: add stashshow subcmd to completion scripts 2022-09-29 07:02:38 +02:00
Xavier Delaruelle
3463d123d0 init: add stashrm subcmd to completion scripts 2022-09-28 07:21:30 +02:00
Xavier Delaruelle
c7ff0fce5f init: add stashpop subcmd to completion scripts 2022-09-28 07:20:54 +02:00
Xavier Delaruelle
705b953a43 init: add stash subcmd to completion scripts 2022-09-20 06:19:33 +02:00
Xavier Delaruelle
9a53011961 init: only source sh or bash init if BASH var is set
Update profile script for sh-like shells to only source sh or bash
initialization script when BASH environment variable is found set.

Fixes #473
2022-09-15 19:44:21 +02:00
Lukáš Zaoral
0877b01865 lint(ShellCheck): fix SC2046 warning
According to ShellCheck's documentation:

When command expansions are unquoted, word splitting and globbing will occur.
This often manifests itself by breaking when filenames contain spaces.

Related: https://www.shellcheck.net/wiki/SC2046
Related: #470
2022-09-02 09:52:05 +02:00
Lukáš Zaoral
d018f7a9e6 lint(ShellCheck): fix SC2086 info diagnostic
Some variables, that were unquoted intentionally were converted to arrays.

According to ShellCheck's documentation:

Quoting variables prevents word splitting and glob expansion, and prevents
the script from breaking when input contains spaces, line feeds, glob
characters and such.

Related: https://www.shellcheck.net/wiki/SC2086
Related: #470
2022-09-02 09:52:05 +02:00
Lukáš Zaoral
169c534a92 lint(ShellCheck): fix SC2178 warning
These occurrences do not seem to cause any problems described below but
let's still fix it for the sake of consistency within this script.

According to ShellCheck's documentation:

ShellCheck noticed that you have used a variable as an array, but then assign
it a string.  array=foo is equivalent to array[0]=foo, and leaves the rest
of the elements unaffected.

Related: https://www.shellcheck.net/wiki/SC2178
Related: #470
2022-09-02 09:52:05 +02:00
Lukáš Zaoral
65309830cb lint(ShellCheck): fix SC2166 warning
According to ShellCheck's documentation:

-a and -o  in [ .. ] test expressions are not well defined, and can cause
incorrect results when arguments start with dashes or contain !.

Related: https://www.shellcheck.net/wiki/SC2166
Related: #470
2022-09-02 09:52:05 +02:00
Lukáš Zaoral
e388118bdc lint(ShellCheck): fix SC1035 error
According to ShellCheck's documentation:

Bourne shells are very whitespace sensitive.  Adding or removing spaces can
drastically alter the meaning of a script.

Related: https://www.shellcheck.net/wiki/SC1035
Related: #470
2022-09-02 09:52:05 +02:00
Lukáš Zaoral
a45f186200 lint(ShellCheck): fix SC2148 error
According to ShellCheck's documentation:

Different shells support different features.  To give effective advice,
ShellCheck needs to know which shell your script is going to run on.

Related: https://www.shellcheck.net/wiki/SC2148
Related: #470
2022-09-02 09:52:05 +02:00
Lukáš Zaoral
d688b538f3 init: add vim modeline to {,b,k}sh scripts
... to enable correct syntax highlighting.
2022-09-02 09:52:05 +02:00
Xavier Delaruelle
e08b0746c6 init: fix too long line issues in tcl 2022-09-01 06:43:38 +02:00
Xavier Delaruelle
565d7052e8 init: add reset_target_state config to completion script 2022-08-25 08:10:01 +02:00
Xavier Delaruelle
0ba8dcbb18 init: add reset subcmd to completion scripts 2022-08-25 08:10:01 +02:00
Xavier Delaruelle
25504c9e22 init: add mod-to-sh subcmd to completion scripts 2022-07-30 16:07:28 +02:00
Xavier Delaruelle
7ae26a1254 install: use install rather mkdir or cp
Use install command rather mkdir or cp to apply regular file mode when
installing Modules. A specific umask configuration set in the current
environment will not impact modes set on installed files.

Follow same approach than Makefiles generated by autotools, with an
INSTALL Makefile variable.
2022-07-18 07:41:19 +02:00
Xavier Delaruelle
4a3c19da9f init: add tcl_linter config to completion script 2022-07-12 07:47:21 +02:00
Xavier Delaruelle
f0cd6d9d8c init: add lint subcmd to completion scripts 2022-07-12 07:43:19 +02:00
Adrien Cotte
972d54776e Zsh completion support for protected_envvars config 2022-07-12 06:39:58 +02:00
Adrien Cotte
9af929fb4a Fish completion support for protected_envvars config 2022-07-12 06:39:58 +02:00
Adrien Cotte
2cd1ad5a3a Bash completion support for protected_envvars config 2022-07-12 06:39:58 +02:00
Xavier Delaruelle
513a039ca4 install: create etcdir from init Makefile if used 2022-06-18 10:39:36 +02:00
Xavier Delaruelle
1411fca904 install: enclose install path refs in Makefiles 2022-06-16 18:57:30 +02:00
Xavier Delaruelle
5aaedd85ca init: enclose installation path references
Update initialization, profile and completion scripts to enclose all
references to the installation paths.

Enclosing modulecmd.tcl installation path this way is not effective with
the quarantine mechanism that implies a double shell code evaluation. So
it is advised not to install Modules in a path containing a whitespace
character if the quarantine mechanism is needed.
2022-06-16 18:57:30 +02:00
Xavier Delaruelle
59ac24e243 init: setup zsh FPATH through autoinit command
Add zsh FPATH setup in autoinit command instead of zsh shell
initialization script. This way all the shell setup is gathered in the
autoinit process. What is left in initialization script is the code to
properly call the autoinit process.

Fixes #462.
2022-06-16 18:57:26 +02:00
Xavier Delaruelle
8d9876ef9a init: setup shell completion through autoinit command
Add shell completion setup in autoinit command instead of shell
initialization scripts. Use this way one modulecmd.tcl internal code
instead of shell code for every shell having some completion to source
(bash, tcsh, fish).

Fixes #462.
2022-06-16 18:57:24 +02:00
Xavier Delaruelle
f269dee47b init: setup MANPATH through autoinit command
Add MANPATH setup in autoinit command instead of shell initialization
scripts. Use this way one modulecmd.tcl internal code instead of shell
code for every shell requiring to setup MANPATH with Modules binaries
location (sh, bash, ksh, zsh, csh, tcsh, fish).

Fixes #462.
2022-06-16 18:57:22 +02:00
Xavier Delaruelle
0660d6fa4e init: setup PATH through autoinit command
Add PATH setup in autoinit command instead of shell initialization
scripts. Use this way one modulecmd.tcl internal code instead of shell
code for every shell requiring to setup PATH with Modules binaries
location (sh, bash, ksh, zsh, csh, tcsh, fish).

Fixes #462.
2022-06-16 18:57:19 +02:00
Xavier Delaruelle
4bea7f213b Export module bash functions directly through autoinit
Export the module, _module_raw and ml bash shell functions directly
through the autoinit sub-command process rather within the bash shell
initialization script.

Cannot apply the same change to the sh shell when it is bash launched as
sh, since we cannot tell in the modulecmd.tcl execution that the current
sh shell is bash (as BASH environment variable is not exported to
sub-shells).

Fixes #462.
2022-06-16 18:56:58 +02:00
Xavier Delaruelle
d6ff7dc130 install: no dependency to version.inc in init/Makefile
The Makefile script in the init directory does not depend on the
definitions stored in the version.inc file. So remove inclusion and
requirement definition to this version.inc file in init/Makefile.
2022-05-31 07:03:22 +02:00
Xavier Delaruelle
b97486fefa init: add collection_pin_tag config to completion scripts 2022-04-01 06:58:35 +02:00