From d763e921418dab339e45406c6083b3540695abd6 Mon Sep 17 00:00:00 2001 From: Todd Gamblin Date: Mon, 24 Dec 2018 13:42:15 -0800 Subject: commands: add `spack resource` command to inspect downloadable files - currently just looks at patches - allows you to find out which package applied a patch to a spec - intended to work with tarballs and resources in the future. - add tab completion for `spack resource` and subcommands --- share/spack/spack-completion.bash | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'share') diff --git a/share/spack/spack-completion.bash b/share/spack/spack-completion.bash index 288746863c..012d2403eb 100755 --- a/share/spack/spack-completion.bash +++ b/share/spack/spack-completion.bash @@ -1041,6 +1041,28 @@ function _spack_repo_rm { _spack_repo_remove } +function _spack_resource { + if $list_options + then + compgen -W "-h --help" -- "$cur" + else + compgen -W "list show" -- "$cur" + fi +} + +function _spack_resource_list { + compgen -W "-h --help --only-hashes" -- "$cur" +} + +function _spack_resource_show { + if $list_options + then + compgen -W "-h --help" -- "$cur" + else + compgen -W "$(_all_resource_hashes)" -- "$cur" + fi +} + function _spack_restage { if $list_options then @@ -1244,6 +1266,10 @@ function _all_packages { spack list } +function _all_resource_hashes { + spack resource list --only-hashes +} + function _installed_packages { spack --color=never find | grep -v "^--" } -- cgit v1.2.3-70-g09d2