You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
def cmd(param):
"""
Executes the cmd.
param: very important parameter
"""
Internally, we still need to use Python 2, so I would love to have this kind of help-text generation in order to reduce usage of the @arg decorator. Btw. it's a great package.
I tackled a similar problem with defopt. I thought I had done my homework before writing yet another argument parser, but apparently I missed argh at the time. In retrospect I think it would have been better as an addition to argh instead of a standalone library.
If you would like to take inspiration from it or want me to help out in some way, I'd be happy to. Ideally it would be great if argh ended up with a superset of defopt's functionality and then I wouldn't need to maintain a separate project.
Note that defopt handles Google/Numpy formats using sphinxcontrib-napoleon, and also a limited set of typing annotations as described in #107.
It seems that this should be configurable, perhaps an extension. I'll try to gather all plugin-ish issues under the appropriate label and see if it makes sense to add such mechanism to Argh.
would you be open to contributions from our team on this issue? We have some experience with argparse and using existing docstring-parsing libraries. I agree that a plugin system seems best; sometimes the best way to design a plugin system is to build the first use case for it and create an experimental plugin API as you go.
Activity
[-]Parameter Documentation viaDocstring[/-][+]Parameter Documentation via Docstring[/+]ewerybody commentedon May 11, 2016
I just thought about that!! :D
Shit is there are different formats within the docstring. for instance
:tag name:)@tag name:)But yeah! Doesn't seem impossible to do :]
joshlk commentedon Aug 10, 2016
This would be a really nice feature. Otherwise your just repeating yourself in the docstring
joshlk commentedon Aug 11, 2016
I've made a pull request #109 which adds a decorator which parses the Sphinx docstring to add type and description information.
It hasn't got tests yet but wanted it out there to see if there is an appetite to merge in.
Any comments? It would be great if someone added to it so it could also parse Google and Numpy style docstrings.
neithere commentedon Aug 26, 2016
Thanks guys, I've commented in PR #109 for now.
evanunderscore commentedon Sep 29, 2016
Hi guys,
I tackled a similar problem with defopt. I thought I had done my homework before writing yet another argument parser, but apparently I missed argh at the time. In retrospect I think it would have been better as an addition to argh instead of a standalone library.
If you would like to take inspiration from it or want me to help out in some way, I'd be happy to. Ideally it would be great if argh ended up with a superset of defopt's functionality and then I wouldn't need to maintain a separate project.
Note that defopt handles Google/Numpy formats using sphinxcontrib-napoleon, and also a limited set of typing annotations as described in #107.
neithere commentedon Feb 7, 2023
It seems that this should be configurable, perhaps an extension. I'll try to gather all plugin-ish issues under the appropriate label and see if it makes sense to add such mechanism to Argh.
petergaultney commentedon Jan 14, 2025
would you be open to contributions from our team on this issue? We have some experience with argparse and using existing docstring-parsing libraries. I agree that a plugin system seems best; sometimes the best way to design a plugin system is to build the first use case for it and create an experimental plugin API as you go.
martinandrovich commentedon Apr 10, 2025
Any update on adding this?