-
Notifications
You must be signed in to change notification settings - Fork 103
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Click help text formatting sugestion #361
Comments
Hi @winxp5421, Thanks for the suggestion. We are aware that click's help output is not the most useful due to being designed for command-line usage. Alternatively you can use regex based commands and @listen_to(
"^add-element +(?P<identifier>[\\w-]+) +[~]?(?P<channel>[\\w-]+) +(?P<url>[^\\s]+)(?: (?P<sensitive_url>[Yy]{1}))?",
allowed_users=settings.PRIVILEGED_USERS,
human_description="add-element <identifier> <channel> <url> [sensitive_url=Y/N]",
category="announce",
privileged=True,
) |
Interesting, I will give that a shot. Will mmpy-bot be dropping click support sometime in the near future? Appreciate the suggestion! |
Me and @attzonko discussed this briefly in the Discord chat. Click is an interesting feature but has some limitations that are a little annoying and difficult to work around. We won't be removing it anytime soon but it's possible that we will deprecate it if we find or implement a good alternative. |
@unode Thank you for your time! |
Click help text formatting when it is posted to mattermost can be very messy.
I have tried changing the click context settings for terminal size, etc. in an attempt to make the output more appealing to the human eye but, ultimately the most straightforward fix I have found is wrapping the help output in a message code block ```
I changed this which seemed to do the trick but, unsure if this was the most graceful way to handle this.
function.py:171
return self.plugin.driver.reply_to(message, f"{e}\n```\n{self.docstring}\n```")
Anyway, please consider adding.
Thanks!
The text was updated successfully, but these errors were encountered: