From dcd8d7a620ad247daf0da771ea22859f9e651ca6 Mon Sep 17 00:00:00 2001 From: "Adam J. Stewart" Date: Fri, 24 Jan 2020 19:28:20 -0600 Subject: Add spack config list command for tab completion (#14474) * Add spack config list command for tab completion * Update tab completion scripts --- share/spack/bash/spack-completion.in | 2 +- share/spack/spack-completion.bash | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) (limited to 'share') diff --git a/share/spack/bash/spack-completion.in b/share/spack/bash/spack-completion.in index 2ab39a57a3..ca15b8dfb2 100755 --- a/share/spack/bash/spack-completion.in +++ b/share/spack/bash/spack-completion.in @@ -218,7 +218,7 @@ _keys() { _config_sections() { if [[ -z "${SPACK_CONFIG_SECTIONS:-}" ]] then - SPACK_CONFIG_SECTIONS="compilers mirrors repos packages modules config upstreams" + SPACK_CONFIG_SECTIONS="$(spack config list)" fi SPACK_COMPREPLY="$SPACK_CONFIG_SECTIONS" } diff --git a/share/spack/spack-completion.bash b/share/spack/spack-completion.bash index 9550137bff..20a5d936ea 100755 --- a/share/spack/spack-completion.bash +++ b/share/spack/spack-completion.bash @@ -218,7 +218,7 @@ _keys() { _config_sections() { if [[ -z "${SPACK_CONFIG_SECTIONS:-}" ]] then - SPACK_CONFIG_SECTIONS="compilers mirrors repos packages modules config upstreams" + SPACK_CONFIG_SECTIONS="$(spack config list)" fi SPACK_COMPREPLY="$SPACK_CONFIG_SECTIONS" } @@ -584,7 +584,7 @@ _spack_config() { then SPACK_COMPREPLY="-h --help --scope" else - SPACK_COMPREPLY="get blame edit" + SPACK_COMPREPLY="get blame edit list" fi } @@ -615,6 +615,10 @@ _spack_config_edit() { fi } +_spack_config_list() { + SPACK_COMPREPLY="-h --help" +} + _spack_configure() { if $list_options then -- cgit v1.2.3-70-g09d2