Skip to content

Commit 2dfb619

Browse files
committed
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.
1 parent 1b0c06a commit 2dfb619

File tree

6 files changed

+7
-4
lines changed

6 files changed

+7
-4
lines changed

.hunspell.en.dic

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1139,3 +1139,4 @@ othervariant
11391139
bitwise
11401140
modpath
11411141
indesym
1142+
syms

NEWS.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@ Modules 5.3.1 (not yet released)
3737
:mconfig:`avail_output` and :mconfig:`avail_terse_output` configuration
3838
options. When set, symbolic versions are reported as independent elements
3939
rather along the module or directory they are attached to.
40+
* Init: fix completion scripts to report module symbolic versions and aliases
41+
among available modules. (fix issue #500)
4042

4143
.. _Hunspell: https://hunspell.github.io/
4244

init/bash_completion.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ _module_avail() {
2020
local cur="${1:-}"
2121
# skip avail call if word currently being completed is an option keyword
2222
if [ -z "$cur" ] || [ "${cur:0:1}" != '-' ]; then
23-
module avail --color=never -s -t -S --no-indepth -o '' "$cur" 2>&1
23+
module avail --color=never -s -t -S --no-indepth -o 'alias:indesym' "$cur" 2>&1
2424
fi
2525
}
2626

init/fish_completion

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ function __fish_module_use_config --description 'Test if module command should h
6363
return 1
6464
end
6565

66-
complete -c module -n '__fish_module_use_avail' -f -a "(module avail --color=never -s -t -S --no-indepth -o '' (commandline -ct) 2>&1)"
66+
complete -c module -n '__fish_module_use_avail' -f -a "(module avail --color=never -s -t -S --no-indepth -o 'alias:indesym' (commandline -ct) 2>&1)"
6767
complete -c module -n '__fish_module_use_list' -f -a "(module list --color=never -s -t -o '' 2>&1)"
6868
complete -c module -n '__fish_module_use_initlist' -f -a "(module initlist --color=never -s 2>&1 | sed '\
6969
/ loads modules:\$/d;')"

init/tcsh_completion.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
#
44

55
alias _module_avail '\\
6-
@TCLSH@ "@libexecdir@/modulecmd.tcl" tcsh avail --color=never -s -t -S -o "" |& cat'
6+
@TCLSH@ "@libexecdir@/modulecmd.tcl" tcsh avail --color=never -s -t -S -o "alias:indesym" |& cat'
77

88
alias _module_loaded '\\
99
@TCLSH@ "@libexecdir@/modulecmd.tcl" tcsh list --color=never -s -t -o "" |& cat'

init/zsh-functions/_module.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ _module_avail() {
99
local cur="${1:-}";
1010
# skip avail call if word currently being completed is an option keyword
1111
if [ -z "$cur" -o "${cur:0:1}" != '-' ]; then
12-
module avail --color=never -s -t -S --no-indepth -o '' $cur 2>&1
12+
module avail --color=never -s -t -S --no-indepth -o 'alias:indesym' $cur 2>&1
1313
fi
1414
}
1515

0 commit comments

Comments
 (0)