[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:
co-authored by
Harry Mellor
parent
900d09f91a
commit
3dafaef027
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user