Skip to content

Modules aliases and symbols bash completion #500

Description

@adrien-cotte

Describe the bug

There is no bash completion for modules described by module-alias and module-version.

To Reproduce

Let's take these modules:

  • gnu/12 (real module)
  • gnu/stable (symbolic version to gnu/12)
  • gcc -> gnu (alias)

Location and content of any modulerc or modulefile involved:

$ cat path/to/modulepath/.modulerc
#%Module
module-alias gcc gnu
module-version gnu/12 stable

Steps to reproduce the behavior (alias):

$ module avail g <tab>-<tab>
gnu/

Steps to reproduce the behavior (symbols):

$ module avail gnu/ <tab>-<tab>
gnu/12

Expected behavior

Expected behavior for alias:

$ module avail g <tab>-<tab>
gnu/ gcc/ 

Expected behavior for symbols:

$ module avail gnu/ <tab>-<tab>
gnu/12 gnu/stable

Modules version and configuration

$ module --version
Modules Release 5.3.0 (2023-05-14)
$ module config --dump-state
Modules Release 5.3.0 (2023-05-14)

- Config. name ---------.- Value (set by if default overridden) ---------------
advanced_version_spec     1
auto_handling             1
avail_indepth             1
avail_output              modulepath:alias:dirwsym:sym:tag:variantifspec:key
avail_terse_output        modulepath:alias:dirwsym:sym:tag:variantifspec
cache_buffer_bytes        32768
cache_expiry_secs         0
collection_pin_tag        0
collection_pin_version    0
collection_target         <undef>
color                     auto
colors                    hi=1:db=2:tr=2:se=2:er=91:wa=93:me=95:in=94:mp=1;94:di=94:al=96:va=93:sy=95:de=4:cm=92:aL=100:L=90;47:H=2:F=41:nF=43:S=46:sS=44:kL=30;48;5;109
contact                   root@localhost
csh_limit                 4000
editor                    vi
extended_default          1
extra_siteconfig          <undef>
home                      /home/acotte/modules-dev/modules-5.3.0/INSTALL.DIR (env-var)
icase                     search
ignore_cache              0
ignore_user_rc            0
ignored_dirs              CVS RCS SCCS .svn .git .SYNC .sos
implicit_default          1
implicit_requirement      1
list_output               header:idx:variant:sym:tag:key
list_terse_output         header
locked_configs            
mcookie_check             always
mcookie_version_check     1
ml                        1
nearly_forbidden_days     14
pager                     /usr/bin/less -eFKRX
protected_envvars         <undef>
quarantine_support        0
rcfile                    <undef>
redirect_output           1
reset_target_state        __init__
run_quarantine            <undef>
search_match              starts_with
set_shell_startup         0
shells_with_ksh_fpath     
silent_shell_debug        0
siteconfig                /home/acotte/modules-dev/modules-5.3.0/INSTALL.DIR/etc/siteconfig.tcl
tag_abbrev                auto-loaded=aL:loaded=L:hidden=H:hidden-loaded=H:forbidden=F:nearly-forbidden=nF:sticky=S:super-sticky=sS:keep-loaded=kL
tag_color_name            
tcl_ext_lib               /home/acotte/modules-dev/modules-5.3.0/INSTALL.DIR/lib/libtclenvmodules.so
tcl_linter                nagelfar.tcl
term_background           dark
term_width                0
unload_match_order        returnlast
variant_shortcut          
verbosity                 normal
wa_277                    0

- State name -----------.- Value ----------------------------------------------
always_read_full_file     1
autoinit                  0
clock_seconds             1687340275
cmdline                   /home/acotte/modules-dev/modules-5.3.0/INSTALL.DIR/libexec/modulecmd.tcl bash config --dump-state
commandname               config
cwd                       /home/acotte/modules-dev/modules-5.3.0
debug_msg_prefix          
domainname                (none)
error_count               0
extra_siteconfig_loaded   0
false_rendered            0
force                     0
hiding_threshold          0
inhibit_errreport         0
inhibit_interp            0
init_error_report         1
is_stderr_tty             1
is_win                    0
kernelversion             #140~18.04.1-Ubuntu SMP Fri Aug 5 11:43:34 UTC 2022
lm_info_cached            0
machine                   x86_64
mode                      
modulefile                {}
modulename                
modulenamevr              
nodename                  UN00306315
os                        Linux
osversion                 5.4.0-124-generic
paginate                  1
path_separator            :
rc_loaded                 /home/acotte/.modulerc
report_format             regular
reportfd                  file4
return_false              0
shell                     bash
shelltype                 sh
siteconfig_loaded         1
specifiedname             
sub1_separator            &
sub2_separator            |
subcmd                    config
subcmd_args               --dump-state
supported_shells          sh bash ksh zsh csh tcsh fish cmd tcl perl python ruby lisp cmake r
tcl_ext_lib_loaded        1
tcl_version               8.6.8
term_columns              142
timer                     0
usergroups                sudo acotte
username                  acotte

- Env. variable --------.- Value ----------------------------------------------
BASH_FUNC__module_raw%%   () {  eval "$(/usr/bin/tclsh '/home/acotte/modules-dev/modules-5.3.0/INSTALL.DIR/libexec/modulecmd.tcl' bash "$@")";
 _mlstatus=$?;
 return $_mlstatus
}
BASH_FUNC_module%%        () {  local _mlredir=1;
 if [ -n "${MODULES_REDIRECT_OUTPUT+x}" ]; then
 if [ "$MODULES_REDIRECT_OUTPUT" = '0' ]; then
 _mlredir=0;
 else
 if [ "$MODULES_REDIRECT_OUTPUT" = '1' ]; then
 _mlredir=1;
 fi;
 fi;
 fi;
 case " $@ " in 
 *' --no-redirect '*)
 _mlredir=0
 ;;
 *' --redirect '*)
 _mlredir=1
 ;;
 esac;
 if [ $_mlredir -eq 0 ]; then
 _module_raw "$@";
 else
 _module_raw "$@" 2>&1;
 fi
}
LOADEDMODULES             
MODULEPATH                /home/acotte/modules-dev/modules-5.3.0/INSTALL.DIR/modulefiles
MODULESHOME               /home/acotte/modules-dev/modules-5.3.0/INSTALL.DIR
MODULES_CMD               /home/acotte/modules-dev/modules-5.3.0/INSTALL.DIR/libexec/modulecmd.tcl
__MODULES_LMINIT          module use --append /home/acotte/modules-dev/modules-5.3.0/INSTALL.DIR/modulefiles

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions