summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2025-07-22 07:42:48 +0200
committerJussi Pakkanen <jussi.pakkanen@mailbox.org>2025-07-29 21:58:47 +0300
commit9dfadc4da1c93f32f8aec739c545b0c712b3f714 (patch)
treee8ea91cb9bd3027f6a5aaff465133120c4b3105e
parente28e726f43df2f762e32e172c6921a400a637c37 (diff)
downloadmeson-9dfadc4da1c93f32f8aec739c545b0c712b3f714.tar.gz
subprojects: add --filter option
-rwxr-xr-xmesonbuild/msubprojects.py13
1 files changed, 9 insertions, 4 deletions
diff --git a/mesonbuild/msubprojects.py b/mesonbuild/msubprojects.py
index 9dac350ab..d4549c054 100755
--- a/mesonbuild/msubprojects.py
+++ b/mesonbuild/msubprojects.py
@@ -641,9 +641,14 @@ def add_common_arguments(p: argparse.ArgumentParser) -> None:
p.add_argument('--allow-insecure', default=False, action='store_true',
help='Allow insecure server connections.')
-def add_subprojects_argument(p: argparse.ArgumentParser) -> None:
- p.add_argument('pattern', dest='subprojects', nargs='*',
- help='Patterns of subprojects to operate on (default: all)')
+def add_subprojects_argument(p: argparse.ArgumentParser, name: str = None) -> None:
+ helpstr = 'Patterns of subprojects to operate on (default: all)'
+ if name:
+ p.add_argument(name, dest='subprojects', metavar='pattern', nargs=1, action='append',
+ default=[], help=helpstr)
+ else:
+ p.add_argument('subprojects', metavar='pattern', nargs='*', default=[],
+ help=helpstr)
def add_wrap_update_parser(subparsers: 'SubParsers') -> argparse.ArgumentParser:
p = subparsers.add_parser('update', help='Update wrap files from WrapDB (Since 0.63.0)')
@@ -693,7 +698,7 @@ def add_arguments(parser: argparse.ArgumentParser) -> None:
p.add_argument('args', nargs=argparse.REMAINDER,
help=argparse.SUPPRESS)
add_common_arguments(p)
- p.set_defaults(subprojects=[])
+ add_subprojects_argument(p, '--filter')
p.set_defaults(subprojects_func=Runner.foreach)
p = subparsers.add_parser('purge', help='Remove all wrap-based subproject artifacts')