spack list: add --count option (#34950)

Sometimes I just want to know how many packages of a certain type there are.

- [x] add `--count` option to `spack list` that output the number of packages that
      *would* be listed.

```console
> spack list --count
6864
> spack list --count py-
2040
> spack list --count r-
1162
```
This commit is contained in:
Todd Gamblin
2023-01-14 16:08:40 -08:00
committed by GitHub
parent ff38ff25cb
commit d4e714bb2e
3 changed files with 32 additions and 9 deletions

View File

@@ -1197,7 +1197,7 @@ _spack_license_update_copyright_year() {
_spack_list() {
if $list_options
then
SPACK_COMPREPLY="-h --help -d --search-description --format --update -v --virtuals -t --tag"
SPACK_COMPREPLY="-h --help -d --search-description --format -v --virtuals -t --tag --count --update"
else
_all_packages
fi