2025-11-16 11:39:27 +01:00
|
|
|
# -*- coding: utf-8 -*-
|
|
|
|
|
|
|
|
|
|
from argparse import Namespace, ArgumentParser
|
|
|
|
|
|
2026-01-26 13:13:12 +01:00
|
|
|
from ...App import Scope
|
2026-01-27 10:22:16 +01:00
|
|
|
from ..Cmd import Cmd
|
|
|
|
|
from ..CmdProjects import CmdProjects
|
2025-11-16 11:39:27 +01:00
|
|
|
|
|
|
|
|
# TODO: seems at least partly redundant to CmdPkgRequires / print_pkg_relations
|
|
|
|
|
class CmdPrereq(Cmd): # export
|
|
|
|
|
|
2026-01-27 10:22:16 +01:00
|
|
|
def __init__(self, parent: CmdProjects) -> None:
|
|
|
|
|
super().__init__(parent, 'prereq', help='path')
|
2025-11-16 11:39:27 +01:00
|
|
|
|
|
|
|
|
def add_arguments(self, parser: ArgumentParser) -> None:
|
|
|
|
|
super().add_arguments(parser)
|
|
|
|
|
parser.add_argument('flavour', help='Flavour')
|
|
|
|
|
parser.add_argument('module', nargs='*', help='Modules')
|
|
|
|
|
|
2026-01-27 14:31:25 +01:00
|
|
|
async def _run(self, args: Namespace) -> None:
|
2025-11-16 11:39:27 +01:00
|
|
|
deps = self.app.get_modules_from_project_txt(args.module, ['pkg.requires.jw'],
|
2026-01-26 13:13:12 +01:00
|
|
|
args.flavour, scope = Scope.Subtree, add_self=False, names_only=True)
|
2025-11-16 11:39:27 +01:00
|
|
|
print(' '.join(deps))
|