[Bugfix][Core] Emit --no-{key} for false BooleanOptionalAction flags in YAML config (#51573)

Signed-off-by: Raj Firke <79653531+rajfirke@users.noreply.github.com>
Signed-off-by: Harry Mellor <19981378+hmellor@users.noreply.github.com>
Co-authored-by: Harry Mellor <19981378+hmellor@users.noreply.github.com>
This commit is contained in:
Raj Vijay Firke
2026-08-10 11:05:15 +00:00
committed by GitHub
co-authored by Harry Mellor
parent 900d09f91a
commit 3dafaef027
2 changed files with 24 additions and 0 deletions
+2
View File
@@ -573,6 +573,8 @@ class FlexibleArgumentParser(ArgumentParser):
if isinstance(value, bool):
if value:
processed_args.append("--" + key)
elif (no_key := f"--no-{key}") in self._option_string_actions:
processed_args.append(no_key)
elif isinstance(value, list):
if value:
processed_args.append("--" + key)