Prevent rewrapping with `\b`
See original GitHub issueHi @ewels, rich-click
is an awesome package and I love that it’s a drop-in replacement for click
. However, I’m running into a small issue with rewrapping. click
uses the \b
flag to prevent rewrapping for a paragraph, which allows you to preserve newlines in a command’s help. rich-click
doesn’t seem to support that flag and removes newlines.
Say you have a command foo
:
@click.command()
def foo():
"""This is a command.
\b
Examples
$ foo
$ foo bar
"""
return
Here’s the output of foo --help
using just click
:
With rich-click
, the newlines are lost.
Using Markdown instead might be an alternative, but would require rewriting docstrings and would break compatibility with click
. Any chance of support being added for \b
in rich-click
?
Thanks!
Issue Analytics
- State:
- Created 2 years ago
- Reactions:1
- Comments:9 (6 by maintainers)
Top Results From Across the Web
How to avoid wrapping text in CSS - html - Stack Overflow
It wraps because the element has a fixed width set on it and the text ”LOW FEES” does not fit into that width....
Read more >How to prevent text from wrapping in a Word document
Next, delete the space between the comma and Ph.D and press Ctrl+Shift+Spacebar. As you can see in Figure B Word couldn't keep the...
Read more >How to prevent line-wrapping in listing block? - Google Groups
Dan Allen. The CSS is responsible for controlling whether wrapping happens or not in a listing / literal block. In the default AsciiDoc...
Read more >How to prevent text in a table cell from wrapping using CSS?
The task is to prevent the text in a table cell from wrapping using CSS. To achieve this we use white-space property of...
Read more >How to disable line wrap in a terminal? - Unix Stack Exchange
You can temporarily disable line wrapping by entering this command:: tput rmam. To restore line wrapping use this command: tput smam.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I thought I had already responded to this but I don’t see my comment here so I guess not.
The issue I had was that I was using rich-click version 1.3.0, and support for this was released in rich-click version 1.3.1.
Once I updated to rich-click 1.3.1, everything works perfectly, as expected.
Thank you for your help and apologies for not checking that before commenting. This package is seriously awesome! 😄
Works perfectly. Thanks for such a quick fix!