[Feature Request] I would like resolvers to access the decorated main function's docstring and the name of the running script, as well as some other capabilities. #2944
Labels
enhancement
Enhanvement request
🚀 Feature Request
hydra/hydra/main.py
Line 80 in f4fe484
Motivation
Is your feature request related to a problem? Please describe.
I want an easy way to specify command line help messages that are semantically annotated with my code, and I use main function docstrings to do this. I currently have a hacky solution, here: https://github.com/mmcdermott/MEDS_transforms/blob/95885836b876d3bcbcae1d2bfd4567ab54595767/src/MEDS_transforms/utils.py#L112C1-L138C34
But this would be much easier to do reliably if it could be implemented in this code base in the decorator for the main function as you'd have access to the function being decorated directly.
Pitch
Describe the solution you'd like
A simple resolver added into the decorator function that returns (via inspect) the docstring of the function being documented.
Describe alternatives you've considered
See the links above for my attempts to get this dynamically without being able to leverage the decorated main function directly.
Are you willing to open a pull request? (See CONTRIBUTING)
Yes.
The text was updated successfully, but these errors were encountered: