Skip to content
Myr

Merge pull request #1796 from MLH-Fellowship/fix-multiline-help

Before adoption: this commit came in with the history the project adopted, so no landing records it.

removed multiline marker from short help text

authored by David Lord · committed by GitHub · parents 81bddec, 244d914 · Browse files · 3 files+23 added−0 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

3 files+23 added−0 removed

  • tests:+19 added−0 removed
  • other:+4 added−0 removed

3 files+23 added−0 removed

modified:src/click/utils.py+3 added
55 unmodified lines
56 total_length = 057 result = []58 done = False5960 if words[0] == "\b":61 words = words[1:]6263 for word in words:64 if word[-1:] == ".":65 done = True66 new_length = 1 + len(word) if result else len(word)
418 unmodified lines
modified:tests/test_formatting.py+19 added
294 unmodified lines
295 " --help Show this message and exit.",296 ]297298299def test_removing_multiline_marker(runner):300 @click.group()301 def cli():302 pass303304 @cli.command()305 def cmd1():306 """\b307 This is command with a multiline help text308 which should not be rewrapped.309 The output of the short help text should310 not contain the multiline marker.311 """312 pass313314 result = runner.invoke(cli, ["--help"])315 assert "\b" not in result.output316317318def test_global_show_default(runner):319 @click.command(context_settings=dict(show_default=True))320 @click.option("-f", "in_file", default="out.txt", help="Output file name")321 def cli():
52 unmodified lines
modified:CHANGES.rst+1 added
171 unmodified lines
172 addition to its type. :issue:`457`173- ``confirmation_prompt`` can be set to a custom string. :issue:`723`174- Allow styled output in Jupyter on Windows. :issue:`1271`175- ``style()`` supports the ``strikethrough`` style. :issue:`805`176- Multiline marker is removed from short help text. :issue:`1597`177178179Version 7.1.2180-------------
635 unmodified lines