diff --git a/mesonbuild/mformat.py b/mesonbuild/mformat.py index 2131ff7b3167..de3b7c50a3c0 100644 --- a/mesonbuild/mformat.py +++ b/mesonbuild/mformat.py @@ -670,7 +670,7 @@ def visit_ArgumentNode(self, node: mparser.ArgumentNode) -> None: if self.config.group_arg_value: for arg in node.arguments[:-1]: group_args = False - if isinstance(arg, mparser.StringNode) and arg.value.startswith('--'): + if isinstance(arg, mparser.StringNode) and arg.value.startswith('--') and arg.value != '--': next_arg = node.arguments[arg_index + 1] if isinstance(next_arg, mparser.StringNode) and not next_arg.value.startswith('--'): group_args = True