summaryrefslogtreecommitdiff
path: root/share
diff options
context:
space:
mode:
authorTodd Gamblin <tgamblin@llnl.gov>2024-01-04 12:35:42 -0800
committerGitHub <noreply@github.com>2024-01-04 12:35:42 -0800
commit533adaaa6d1ebea3b1e6d634d67e5185cea2fe95 (patch)
tree958201b6087e16944d17679c99ad14e571dd4608 /share
parent3a15f57b45ec35f6d1d672cfc8b95a96a75403cd (diff)
downloadspack-533adaaa6d1ebea3b1e6d634d67e5185cea2fe95.tar.gz
spack-533adaaa6d1ebea3b1e6d634d67e5185cea2fe95.tar.bz2
spack-533adaaa6d1ebea3b1e6d634d67e5185cea2fe95.tar.xz
spack-533adaaa6d1ebea3b1e6d634d67e5185cea2fe95.zip
`spack list`: add `--namesapce` / `--repo` option (#41948)
This adds options to `spack list` that allow you to list only packages from specific repositories/namespaces, e.g.: ```console spack list -r builtin ``` only lists packages from the `builtin` repo, while: ```console spack list -r myrepo -r myrepo2 ``` would list packages from `myrepo` and `myrepo2`, but not from `builtin`. Note that you can use the same argument multiple times. You can use either `-r` / `--repo` or `-N` / `--namespace`. `-N` is there to match the corresponding option on `spack find`. - [x] add `-r` / `--repo` / `-N` / `--namespace` argument - [x] add test
Diffstat (limited to 'share')
-rwxr-xr-xshare/spack/spack-completion.bash2
-rwxr-xr-xshare/spack/spack-completion.fish4
2 files changed, 4 insertions, 2 deletions
diff --git a/share/spack/spack-completion.bash b/share/spack/spack-completion.bash
index 6193982774..1cad9c3da9 100755
--- a/share/spack/spack-completion.bash
+++ b/share/spack/spack-completion.bash
@@ -1320,7 +1320,7 @@ _spack_license_update_copyright_year() {
_spack_list() {
if $list_options
then
- SPACK_COMPREPLY="-h --help -d --search-description --format -v --virtuals -t --tag --count --update"
+ SPACK_COMPREPLY="-h --help -r --repo -N --namespace -d --search-description --format -v --virtuals -t --tag --count --update"
else
_all_packages
fi
diff --git a/share/spack/spack-completion.fish b/share/spack/spack-completion.fish
index 31aba0aa7d..2cd66977d1 100755
--- a/share/spack/spack-completion.fish
+++ b/share/spack/spack-completion.fish
@@ -2017,10 +2017,12 @@ complete -c spack -n '__fish_spack_using_command license update-copyright-year'
complete -c spack -n '__fish_spack_using_command license update-copyright-year' -s h -l help -d 'show this help message and exit'
# spack list
-set -g __fish_spack_optspecs_spack_list h/help d/search-description format= v/virtuals t/tag= count update=
+set -g __fish_spack_optspecs_spack_list h/help r/repo= d/search-description format= v/virtuals t/tag= count update=
complete -c spack -n '__fish_spack_using_command_pos_remainder 0 list' -f -a '(__fish_spack_packages)'
complete -c spack -n '__fish_spack_using_command list' -s h -l help -f -a help
complete -c spack -n '__fish_spack_using_command list' -s h -l help -d 'show this help message and exit'
+complete -c spack -n '__fish_spack_using_command list' -s r -l repo -s N -l namespace -r -f -a repos
+complete -c spack -n '__fish_spack_using_command list' -s r -l repo -s N -l namespace -r -d 'only list packages from the specified repo/namespace'
complete -c spack -n '__fish_spack_using_command list' -s d -l search-description -f -a search_description
complete -c spack -n '__fish_spack_using_command list' -s d -l search-description -d 'filtering will also search the description for a match'
complete -c spack -n '__fish_spack_using_command list' -l format -r -f -a 'name_only version_json html'