From 58b38fba94fcad7962a3fce670082d222fb62af2 Mon Sep 17 00:00:00 2001 From: Andreas Gampe Date: Fri, 20 Oct 2023 16:31:13 -0700 Subject: [PATCH] Fix argparse_yes_no_flag Summary: Lower-case `-` for the destination field. Reviewed By: wsanville Differential Revision: D50503260 fbshipit-source-id: 71ea352c8831d895870475d80e4dbc4d9f312e88 --- pyredex/utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyredex/utils.py b/pyredex/utils.py index b2e85b5a69b..153e4fd7180 100644 --- a/pyredex/utils.py +++ b/pyredex/utils.py @@ -418,7 +418,7 @@ def __call__(self, parser, namespace, values, option_string=None): parser.add_argument( f"--{on_prefix}{flag_name}", f"--{off_prefix}{flag_name}", - dest=flag_name, + dest=flag_name.replace("-", "_"), action=FlagAction, default=False, **kwargs,