We're using the latest ConfigArgParse (1.5.2) with python 3.7 and trying to add our custom argparse action similarly to the BooleanOptionalAction.
In our case, if we have argument '--enable-feature', '--disable-feature', action=CustomBooleanOptionalAction and we have enable-feature in the config file, convert_item_to_command_line_arg converts it to --disable-feature=true.
For one, it is not correct. Additionally, argparse will raise an exception because this action does not expect argument value (ignored explicit argument true).
This issue is similar with what is mentioned in #248.
But in our case we want support for custom actions.
As a hacky solution we monkeypatched convert_item_to_command_line_arg to return f'--{key}'. Maybe it is not as bad of an idea considering that all of the config keys are checked up to this point and are guaranteed to be valid.
We're using the latest ConfigArgParse (1.5.2) with python 3.7 and trying to add our custom
argparse
action similarly to theBooleanOptionalAction
.In our case, if we have argument
'--enable-feature', '--disable-feature', action=CustomBooleanOptionalAction
and we haveenable-feature
in the config file,convert_item_to_command_line_arg
converts it to--disable-feature=true
. For one, it is not correct. Additionally,argparse
will raise an exception because this action does not expect argument value (ignored explicit argument true
).This issue is similar with what is mentioned in #248. But in our case we want support for custom actions.
As a hacky solution we monkeypatched
convert_item_to_command_line_arg
to returnf'--{key}'
. Maybe it is not as bad of an idea considering that all of the config keys are checked up to this point and are guaranteed to be valid.