-
Notifications
You must be signed in to change notification settings - Fork 38
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
Command panels don't support multi-line strings #23
Comments
Thanks for reporting! Does this work as you'd expect with vanilla click output? |
Vanilla click doesn't allow command descriptions to be rendered over multiple lines, but it does support multi-line strings that use Because the command descriptions are limited to a single line, click tries to be smart and only displays the text that comes before the first period: def test_command(input, output, threads):
"""
Let's build an almighty mountain. Maybe, just to play a little, we'll put a
little tree here. Look around, look at what we have. Beauty is everywhere,
you only have to look to see it. The only prerequisite is that it makes you
happy. If it makes you happy then it's good. We don't have to be concerned
about it. We just have to let it fall where it will. By now you should be
quite happy about what's happening here.
"""
If there's no period before the maximum width of the help dialog, it will use ellipsis: def test_command(input, output, threads):
"""
Let's build an almighty mountain Maybe, just to play a little, we'll put a
little tree here. Look around, look at what we have. Beauty is everywhere,
you only have to look to see it. The only prerequisite is that it makes you
happy. If it makes you happy then it's good. We don't have to be concerned
about it. We just have to let it fall where it will. By now you should be
quite happy about what's happening here.
"""
My preference is the way |
Thanks 🙏🏻 I think displaying the full text is better too (might be scope for a config option there though I guess 🤔). I'll take a look into fixing this ASAP. |
Ok, this should now be fixed. I think that the previous behaviour of only printing the first line was there because I was trying to mimic the click behaviour of showing a short help text for groups but then having longer help text when doing help on that specific subcommand. Now it's slightly smarter and takes the first paragraph, according to double newlines. Single newlines are stripped (unless using Markdown, but then they're ignored). |
I'm used to write down the description of commands within
"""
because they can get long. However, it seems thatrich-click
can't render multi-line strings within the panels. Only the first line is shown.Multi-line:
This is fixed when I put the text in a single line:
The text was updated successfully, but these errors were encountered: