Closed pfrwilson closed 10 months ago
Hello there @pfrwilson ! Thanks for posting!
The __doc__
of the dataclass is used to generate the group help text, and this is the auto-generated one from dataclasses.dataclass
. Adding a docstring is a work-around, however you're right, there should probably be a help
argument to parser.add_arguments
that would override this. Good idea! :)
P.S. this project is absolutely brilliant and has made my life at least 250% better overall.
Haha happy you like it! Would you be interested in contributing a PR for this? I would gladly give you some pointers if you're interested, but no pressure! :)
Hi @lebrice , sorry for the late reply. After a few months of use with your suggestion (using dataclass docstrings to make more user-friendly config messages) I think it's perfectly satisfactory. It would be nice to see some more advanced formatting options (imagine if we had rich-formatted help messages!) but sadly I don't have the bandwidth to help with this right now, although i'll definitely keep it in mind and may reach out at some point again about it when I have more bandwidth.
Thanks again!
Is your feature request related to a problem? Please describe. I find the default help message to be a little cluttered. See, for example, here:
In particular, displaying the repr of the config class and nested config subgroups significantly clutters the display and, to me, doesn't provide much extra help when understanding the arguments. It's especially true when there are many argument subgroups, and even nested argument subgroups...
Describe the solution you'd like I think having the option to display it more like this:
And having the option to provide a "Name" to the subgroup (just like arparse.ArgumentParser.add_argument_group(...)) Would potentially allow for a cleaner looking display.
Thanks so much for considering this request! If there is already some documentation covering this, I apologize in advance.
P.S. this project is absolutely brilliant and has made my life at least 250% better overall.