Environments: add flag to skip printing concretized specs (#30272)

With an active environment, you can now run "spack concretize --quiet"
and it will suppress printing the concretized specs.
This commit is contained in:
iarspider 2022-04-26 00:54:54 +02:00 committed by GitHub
parent 3ade5516a2
commit 834f8e04ca
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 2 deletions

View File

@ -22,6 +22,9 @@ def setup_parser(subparser):
help="""Concretize with test dependencies. When 'root' is chosen, test help="""Concretize with test dependencies. When 'root' is chosen, test
dependencies are only added for the environment's root specs. When 'all' is dependencies are only added for the environment's root specs. When 'all' is
chosen, test dependencies are enabled for all packages in the environment.""") chosen, test dependencies are enabled for all packages in the environment.""")
subparser.add_argument(
'-q', '--quiet', action='store_true',
help="Don't print concretized specs")
spack.cmd.common.arguments.add_concretizer_args(subparser) spack.cmd.common.arguments.add_concretizer_args(subparser)
@ -38,5 +41,6 @@ def concretize(parser, args):
with env.write_transaction(): with env.write_transaction():
concretized_specs = env.concretize(force=args.force, tests=tests) concretized_specs = env.concretize(force=args.force, tests=tests)
ev.display_specs(concretized_specs) if not args.quiet:
ev.display_specs(concretized_specs)
env.write() env.write()

View File

@ -709,7 +709,7 @@ _spack_compilers() {
} }
_spack_concretize() { _spack_concretize() {
SPACK_COMPREPLY="-h --help -f --force --test -U --fresh --reuse" SPACK_COMPREPLY="-h --help -f --force --test -q --quiet -U --fresh --reuse"
} }
_spack_config() { _spack_config() {