Closed tristanlatr closed 3 years ago
Hi tristan, this seems like a very niche use-case. Also, it's difficult to generalize to different config file formats. Unless more people are interested, I would recommend forking the repo and adding this to your own version.
Hi @bw2,
Could you re-open this issue since it's a missing feature from configargparse ? Also, it's more likely to be seen by other users and upvoted if it's actually open.
I would argue that setup.cfg, project.toml files are becomming more and more popular.
Anyway, I'll implement an alternative ConfigFileParser subclass that support this kind of stuff. Without touching the main ArgumentParser object. So maybe it can be merged as an extra config parser subclass.
This is a duplicate of #250, in which I proposed a simple and maintainable solution to support configuration sections.
The use case I'm thinking of is the following:
I would like to use
ConfigArgParse
to parse a part of mysetup.cfg
file only. If I pass the whole file, they might have conflicts in the names!For instance, pytest accepts a section
[tool:pytest]
inside thesetup.cfg
.A simple argument like the following should be sufficient:
Tell me if that's not too hard, I can give it a go!
Thanks