From 5b8b7a5873672170ce57a84e5d1ca0b0e065d933 Mon Sep 17 00:00:00 2001 From: Massimiliano Culpo Date: Mon, 23 Jul 2018 08:05:55 +0200 Subject: The auto-completion file is now consistent with `spack module` --- share/spack/spack-completion.bash | 134 +++++++++++++++++++++++++++++++++++--- 1 file changed, 124 insertions(+), 10 deletions(-) diff --git a/share/spack/spack-completion.bash b/share/spack/spack-completion.bash index e562248d9d..e5de003814 100755 --- a/share/spack/spack-completion.bash +++ b/share/spack/spack-completion.bash @@ -647,44 +647,158 @@ function _spack_module { then compgen -W "-h --help" -- "$cur" else - compgen -W "find loads refresh rm" -- "$cur" + compgen -W "lmod tcl dotkit" -- "$cur" fi } -function _spack_module_find { +function _spack_module_tcl { if $list_options then - compgen -W "-h --help --full-path -m --module-type" -- "$cur" + compgen -W "-h --help" -- "$cur" + else + compgen -W "refresh find rm loads" -- "$cur" + fi +} + + +function _spack_module_tcl_find { + if $list_options + then + compgen -W "-h --help --full-path -r --dependencies" -- "$cur" else compgen -W "$(_installed_packages)" -- "$cur" fi } -function _spack_module_loads { +function _spack_module_tcl_loads { if $list_options then compgen -W "-h --help --input-only -p --prefix -x --exclude - -m --module-type -r --dependencies" -- "$cur" + -r --dependencies" -- "$cur" else compgen -W "$(_installed_packages)" -- "$cur" fi } -function _spack_module_refresh { +function _spack_module_tcl_refresh { if $list_options then - compgen -W "-h --help --delete-tree -m --module-type - -y --yes-to-all" -- "$cur" + compgen -W "-h --help --delete-tree -y --yes-to-all" -- "$cur" + else + compgen -W "$(_installed_packages)" -- "$cur" + fi +} + +function _spack_module_tcl_rm { + if $list_options + then + compgen -W "-h --help -y --yes-to-all" -- "$cur" + else + compgen -W "$(_installed_packages)" -- "$cur" + fi +} + +function _spack_module_dotkit { + if $list_options + then + compgen -W "-h --help" -- "$cur" + else + compgen -W "refresh find rm loads" -- "$cur" + fi +} + + +function _spack_module_dotkit_find { + if $list_options + then + compgen -W "-h --help --full-path -r --dependencies" -- "$cur" + else + compgen -W "$(_installed_packages)" -- "$cur" + fi +} + +function _spack_module_dotkit_loads { + if $list_options + then + compgen -W "-h --help --input-only -p --prefix -x --exclude + -r --dependencies" -- "$cur" + else + compgen -W "$(_installed_packages)" -- "$cur" + fi + +} + +function _spack_module_dotkit_refresh { + if $list_options + then + compgen -W "-h --help --delete-tree -y --yes-to-all" -- "$cur" else compgen -W "$(_installed_packages)" -- "$cur" fi } -function _spack_module_rm { +function _spack_module_dotkit_rm { if $list_options then - compgen -W "-h --help -m --module-type -y --yes-to-all" -- "$cur" + compgen -W "-h --help -y --yes-to-all" -- "$cur" + else + compgen -W "$(_installed_packages)" -- "$cur" + fi +} + +function _spack_module_lmod { + if $list_options + then + compgen -W "-h --help" -- "$cur" + else + compgen -W "refresh find rm loads setdefault" -- "$cur" + fi +} + + +function _spack_module_lmod_find { + if $list_options + then + compgen -W "-h --help --full-path -r --dependencies" -- "$cur" + else + compgen -W "$(_installed_packages)" -- "$cur" + fi +} + +function _spack_module_lmod_loads { + if $list_options + then + compgen -W "-h --help --input-only -p --prefix -x --exclude + -r --dependencies" -- "$cur" + else + compgen -W "$(_installed_packages)" -- "$cur" + fi + +} + +function _spack_module_lmod_refresh { + if $list_options + then + compgen -W "-h --help --delete-tree -y --yes-to-all" -- "$cur" + else + compgen -W "$(_installed_packages)" -- "$cur" + fi +} + +function _spack_module_lmod_rm { + if $list_options + then + compgen -W "-h --help -y --yes-to-all" -- "$cur" + else + compgen -W "$(_installed_packages)" -- "$cur" + fi +} + +function _spack_module_lmod_setdefault { + if $list_options + then + compgen -W "-h --help" -- "$cur" else compgen -W "$(_installed_packages)" -- "$cur" fi -- cgit v1.2.3-60-g2f50