errbot
errbot copied to clipboard
Improve command help text output
In order to let us help you better, please fill out the following fields as best you can:
I am...
- [ ] Reporting a bug
- [x] Suggesting a new feature
- [ ] Requesting help with running my bot
- [ ] Requesting help writing plugins
- [ ] Here about something else
I am running...
- Errbot version: 4.3.4
- OS version: Fedora 24
- Python version: 3.5.2
- Using a virtual environment: no
Issue description
The help text for a sub-command displays the method docstring, which can sometimes look good, but most of time time looks plain or cryptic. It would be nice if the help could include generated text based on any arguments specified by the sub-command.
It looks like most of the code is following plain ReStructuredText docstring style. Maybe a tool like Sphinx could help parse the docstring? Then the help rendering function could format the parsed text. The BOT_PREFIX
character could also be used in the output instead of relying on everyone using !
.
Steps to reproduce
errbot/core_plugins/utils.py
turns the docstring into the picture.
@botcmd(admin_only=True)
def log_tail(self, msg, args):
""" Display a tail of the log of n lines or 40 by default
use : !log tail 10
"""
Our command docstring using Google Style turns into the picture.
@botcmd(split_args_with=' ')
def spinnaker_pipelineupdate(self, msg, args):
"""Update an application pipeline
Args:
url (str): Application git repo URL.
Example:
!pipeline update url=forrest/edge
"""
Additional info
No more information.