cmd/dependents.py: accept deptype

This commit is contained in:
Wouter Deconinck 2024-07-10 14:01:39 -05:00 committed by GitHub
parent 4f18cab8d2
commit 15fb41f3fa
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -36,6 +36,7 @@ def setup_parser(subparser):
default=False, default=False,
help="show all transitive dependents", help="show all transitive dependents",
) )
arguments.add_common_arguments(subparser, ["deptype"])
arguments.add_common_arguments(subparser, ["spec"]) arguments.add_common_arguments(subparser, ["spec"])
@ -107,7 +108,9 @@ def dependents(parser, args):
format_string = "{name}{@version}{%compiler}{/hash:7}" format_string = "{name}{@version}{%compiler}{/hash:7}"
if sys.stdout.isatty(): if sys.stdout.isatty():
tty.msg("Dependents of %s" % spec.cformat(format_string)) tty.msg("Dependents of %s" % spec.cformat(format_string))
deps = spack.store.STORE.db.installed_relatives(spec, "parents", args.transitive) deps = spack.store.STORE.db.installed_relatives(
spec, "parents", args.transitive, deptype=args.deptype
)
if deps: if deps:
spack.cmd.display_specs(deps, long=True) spack.cmd.display_specs(deps, long=True)
else: else: