Closed missionfloyd closed 3 years ago
can you do something like args = parser.parse_args("--arg1 foo --arg2 bar")
instead?
fixing this will probably requiring modifying https://github.com/bw2/ConfigArgParse/blob/master/configargparse.py#L686-L716 if you'd like to submit a PR.
can you do something like
args = parser.parse_args("--arg1 foo --arg2 bar")
instead?
That almost works. Setting just one like that clears the other. I guess I could pass the current values of all the others.
I was able work around it by setting a default and then treating it as None
when validating input.
I'm trying to update and write out args, but write_config_file will only write args that have a default value or were passed via commandline. Any that were
None
, or that were read from the config file are ignored.Here's a example (
test.py
)After running
python test.py
,test.conf
containsBut running
python test.py --arg1 something
results inas expected.