Package: environment-modules
Version: 4.0.0-1
Severity: normal

Dear Maintainer,

Somehow the bash autocompletion did not work. I updatetd from 3.2 to 4.0.

To fix the autocompletion I had to move /usr/share/modules/init/bash_completion 
to /etc/bash_completion.d/modules and overwrite the old config to make it work.

Best,

Andreas

*** Reporter, please consider answering these questions, where appropriate ***

   * What led up to the situation?
   * What exactly did you do (or not do) that was effective (or
     ineffective)?
   * What was the outcome of this action?
   * What outcome did you expect instead?

*** End of the template - remove these template lines ***


-- System Information:
Debian Release: buster/sid
  APT prefers testing
  APT policy: (990, 'testing'), (900, 'stable'), (500, 'unstable'), (1, 
'experimental')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 4.13.0-1-amd64 (SMP w/8 CPU cores)
Locale: LANG=de_DE.UTF-8, LC_CTYPE=de_DE.UTF-8 (charmap=ANSI_X3.4-1968) 
(ignored: LC_ALL set to C), LANGUAGE= (charmap=ANSI_X3.4-1968) (ignored: LC_ALL 
set to C)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)

Versions of packages environment-modules depends on:
ii  debhelper  10.9.2
ii  libc6      2.24-17
ii  libtcl8.6  8.6.7+dfsg-1
ii  tcl        8.6.0+9
ii  tcl8.6     8.6.7+dfsg-1

environment-modules recommends no packages.

environment-modules suggests no packages.

-- Configuration Files:
/etc/bash_completion.d/modules changed:
_module_avail() {
    echo "test"
    module avail -t 2>&1 | sed '
        /^-\+/d; /^\s*$/d;
        /->.*$/d;
        /:$/d;
        /:ERROR:/d;
        s#^\(.*\)/\(.\+\)(.*default.*)#\1\n\1\/\2#;
        s#(.*)$##g;
        s#\s*$##g;
        s#/*$##g;'
}
_module_savelist() {
    module savelist -t 2>&1 | sed '
        /Named collection list$/d;
        /:$/d;
        /:ERROR:/d;'
}
_module_not_yet_loaded() {
    _module_avail | sort | sed -r "\%^(${LOADEDMODULES//:/|})$%d"
}
_module_long_arg_list() {
    local cur="$1" i
    if [[ ${COMP_WORDS[COMP_CWORD-2]} == sw* ]]
    then
        COMPREPLY=( $(compgen -W "$(_module_not_yet_loaded)" -- "$cur") )
        return
    fi
    for ((i = COMP_CWORD - 1; i > 0; i--))
        do case ${COMP_WORDS[$i]} in
        add|load)
            COMPREPLY=( $(compgen -W "$(_module_not_yet_loaded)" -- "$cur") )
            break;;
        rm|remove|unload|switch|swap)
            COMPREPLY=( $(IFS=: compgen -W "${LOADEDMODULES}" -- "$cur") )
            break;;
        esac
    done
}
if [ "$MODULES_USE_COMPAT_VERSION" = '1' ]; then
_module() {
   local cur="$2" prev="$3" cmds opts
   COMPREPLY=()
   cmds="add apropos avail clear display help\
      initadd initclear initlist initprepend initrm initswitch\
      keyword list load purge refresh rm show swap switch\
      unload unuse update use whatis"
   opts="-c -f -h -i -l -s -t -u -v -H -V\
      --create --force  --help  --human   --icase\
      --long   --silent --terse --userlvl --verbose --version"
   case "$prev" in
   add|load)   COMPREPLY=( $(compgen -W "$(_module_not_yet_loaded)" -- "$cur") 
);;
   rm|remove|unload|switch|swap)
      COMPREPLY=( $(IFS=: compgen -W "${LOADEDMODULES}" -- "$cur") );;
   unuse)      COMPREPLY=( $(IFS=: compgen -W "${MODULEPATH}" -- "$cur") );;
   use|*-a*)   ;;       # let readline handle the completion
   -u|--userlvl)  COMPREPLY=( $(compgen -W "novice expert advanced" -- "$cur") 
);;
   av*|disp*|help|show|whatis)
      COMPREPLY=( $(compgen -W "$(_module_avail)" -- "$cur") );;
   *) if test $COMP_CWORD -gt 2
      then
      _module_long_arg_list "$cur"
      else
      case "$cur" in
      # The mappings below are optional abbreviations for convenience
      ls)   COMPREPLY="list";;   # map ls -> list
      r*)   COMPREPLY="rm";;  # also covers 'remove'
      sw*)  COMPREPLY="switch";;
      -*)   COMPREPLY=( $(compgen -W "$opts" -- "$cur") );;
      *) COMPREPLY=( $(compgen -W "$cmds" -- "$cur") );;
      esac
      fi;;
   esac
}
else
_module() {
    local cur="$2" prev="$3" cmds opts
    COMPREPLY=()
    cmds="add apropos aliases avail display help\
        initadd initclear initlist initprepend initrm\
        keyword list load path paths purge refresh reload restore\
        rm save savelist saveshow saverm search show source swap\
        switch test unload unuse use whatis"
    opts="-D -h -V --debug --help --version"
    list_opts="-l -t --long --terse"
    avail_opts="-d -L -l -t --default --latest --long --terse"
    case "$prev" in
    add|load)       COMPREPLY=( $(compgen -W "$(_module_not_yet_loaded)" -- 
"$cur") );;
    avail)          COMPREPLY=( $(compgen -W "$avail_opts $(_module_avail)" -- 
"$cur") );;
    list|savelist)  COMPREPLY=( $(compgen -W "$list_opts" -- "$cur") );;
    restore|save|saveshow|saverm)
                    COMPREPLY=( $(compgen -W "$(_module_savelist)" -- "$cur") 
);;
    rm|remove|unload|switch|swap)
                    COMPREPLY=( $(IFS=: compgen -W "${LOADEDMODULES}" -- 
"$cur") );;
    unuse)          COMPREPLY=( $(IFS=: compgen -W "${MODULEPATH}" -- "$cur") 
);;
    use|*-a*)   ;;                      # let readline handle the completion
    display|help|show|test|whatis)
                    COMPREPLY=( $(compgen -W "$(_module_avail)" -- "$cur") );;
    
-h|--help|-V|--version|aliases|apropos|keyword|purge|refresh|reload|search|source)
                    ;;
    initadd|initclear|initlist|initprepend|initrm)
                    ;;
    *)  if test $COMP_CWORD -gt 2
        then
            _module_long_arg_list "$cur"
        else
            case "$cur" in
            # The mappings below are optional abbreviations for convenience
            ls)     COMPREPLY="list";;      # map ls -> list
            sw*)    COMPREPLY="switch";;
            -*)     COMPREPLY=( $(compgen -W "$opts" -- "$cur") );;
            *)      COMPREPLY=( $(compgen -W "$opts $cmds" -- "$cur") );;
            esac
        fi;;
    esac
}
fi
complete -o default -F _module module


-- no debconf information

Reply via email to