diff --git a/src/python/jw/pkg/cmds/projects/BaseCmdPkgRelations.py b/src/python/jw/pkg/cmds/projects/BaseCmdPkgRelations.py index 8f36ff9f..d92a75ab 100644 --- a/src/python/jw/pkg/cmds/projects/BaseCmdPkgRelations.py +++ b/src/python/jw/pkg/cmds/projects/BaseCmdPkgRelations.py @@ -32,6 +32,7 @@ class BaseCmdPkgRelations(Cmd): ignore: set[str] = set(), quote: bool = False, skip_excluded: bool = False, + hide_self = False, ) -> list[str]: if subsections is None: @@ -122,6 +123,8 @@ class BaseCmdPkgRelations(Cmd): case _: raise NotImplementedError(f'Expanding SemVer range "{dep[0]} {dep[1]} {dep[3]}" is not yet implemented') for expanded_dep in expanded_deps: + if hide_self and dep_name in modules: + continue match syntax: case self.Syntax.semver: pass @@ -158,6 +161,7 @@ class BaseCmdPkgRelations(Cmd): ignore = set(args.ignore.split(',')), quote = args.quote, skip_excluded = args.skip_excluded, + hide_self = args.hide_self, ) ) @@ -190,6 +194,8 @@ class BaseCmdPkgRelations(Cmd): 'should be ignored together with their dependencies') parser.add_argument('--skip-excluded', action='store_true', default=False, help='Don\'t consider or output modules matching the os cascade in their [build].exclude config') + parser.add_argument('--hide-self', action='store_true', default=False, + help='Don\'t include any of the projects listed in in the output') parser.add_argument('--quote', action='store_true', default=False, help='Put double quotes around each listed dependency')