@@ -147,16 +147,20 @@ _module() {
147147
148148 case " ${prev} " in
149149 add|load|try-load)
150- COMPREPLY=( $( compgen -W " $( _module_not_yet_loaded) " -- " ${cur} " ) )
150+ # COMPREPLY=( $(compgen -W "$(_module_not_yet_loaded)" -- "${cur}") )
151+ _module_comgen_words " $( _module_not_yet_loaded) " " $cur "
151152 ;;
152153 rm|remove|unload|switch|swap)
153- COMPREPLY=( $( compgen -W " $( _module_loaded_modules) " -- " ${cur} " ) )
154+ # COMPREPLY=( $(compgen -W "$(_module_loaded_modules)" -- "${cur}") )
155+ _module_comgen_words " $( _module_loaded_modules) " " $cur "
154156 ;;
155157 restore)
156- COMPREPLY=( $( compgen -W " $( _module_savelist) " -- " ${cur} " ) )
158+ # COMPREPLY=( $(compgen -W "$(_module_savelist)" -- "${cur}") )
159+ _module_comgen_words " $( _module_savelist) " " $cur "
157160 ;;
158161 spider)
159- COMPREPLY=( $( compgen -W " $( _module_spider) " -- " ${cur} " ) )
162+ # COMPREPLY=( $(compgen -W "$(_module_spider)" -- "${cur}") )
163+ _module_comgen_words " $( _module_spider) " " $cur "
160164 ;;
161165 unuse)
162166 COMPREPLY=( $( IFS=: compgen -W " ${MODULEPATH} " -- " ${cur} " ) )
@@ -165,13 +169,16 @@ _module() {
165169 _module_dir " ${cur} "
166170 ;;
167171 help|show|whatis)
168- COMPREPLY=( $( compgen -W " $( _module_avail) " -- " ${cur} " ) )
172+ # COMPREPLY=( $(compgen -W "$(_module_avail)" -- "${cur}") )
173+ _module_comgen_words " $( _module_avail) " " $cur "
169174 ;;
170175 describe|mcc)
171- COMPREPLY=( $( compgen -W " $( _module_mcc) " -- " ${cur} " ) )
176+ # COMPREPLY=( $(compgen -W "$(_module_mcc)" -- "${cur}") )
177+ _module_comgen_words " $( _module_mcc) " " $cur "
172178 ;;
173179 disable)
174- COMPREPLY=( $( compgen -W " $( _module_mcc) " -- " ${cur} " ) )
180+ # COMPREPLY=( $(compgen -W "$(_module_mcc)" -- "${cur}") )
181+ _module_comgen_words " $( _module_mcc) " " $cur "
175182 ;;
176183 * )
177184 if [ ${COMP_CWORD} -gt 2 ]; then
@@ -216,13 +223,16 @@ _ml() {
216223
217224 case " ${prev} " in
218225 rm|remove|unload|switch|swap)
219- COMPREPLY=( $( compgen -W " $( _module_loaded_modules) " -- " ${cur} " ) )
226+ # COMPREPLY=( $(compgen -W "$(_module_loaded_modules)" -- "${cur}") )
227+ _module_comgen_words " $( _module_loaded_modules) " " $cur "
220228 ;;
221229 restore)
222- COMPREPLY=( $( compgen -W " $( _module_savelist) " -- " ${cur} " ) )
230+ # COMPREPLY=( $(compgen -W "$(_module_savelist)" -- "${cur}") )
231+ _module_comgen_words " $( _module_savelist) " " $cur "
223232 ;;
224233 spider)
225- COMPREPLY=( $( compgen -W " $( _module_spider) " -- " ${cur} " ) )
234+ # COMPREPLY=( $(compgen -W "$(_module_spider)" -- "${cur}") )
235+ _module_comgen_words " $( _module_spider) " " $cur "
226236 ;;
227237 unuse)
228238 COMPREPLY=( $( IFS=: compgen -W " ${MODULEPATH} " -- " ${cur} " ) )
@@ -231,7 +241,16 @@ _ml() {
231241 _module_dir " ${cur} "
232242 ;;
233243 help|show|whatis)
234- COMPREPLY=( $( compgen -W " $( _module_avail) " -- " ${cur} " ) )
244+ # COMPREPLY=( $(compgen -W "$(_module_avail)" -- "${cur}") )
245+ _module_comgen_words " $( _module_avail) " " $cur "
246+ ;;
247+ describe|mcc)
248+ # COMPREPLY=( $(compgen -W "$(_module_mcc)" -- "${cur}") )
249+ _module_comgen_words " $( _module_mcc) " " $cur "
250+ ;;
251+ disable)
252+ # COMPREPLY=( $(compgen -W "$(_module_mcc)" -- "${cur}") )
253+ _module_comgen_words " $( _module_mcc) " " $cur "
235254 ;;
236255 * )
237256 case " ${cur} " in
0 commit comments