Skip to content
Myr

Merge pull request #1406 from jcrotts/issue_834

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

Make option format replace newlines with spaces.

authored by David Lord · committed by GitHub · parents a93b797, 21ebcb6 · Browse files · 3 files+5 added−4 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+5 added−4 removed

  • tests:+1 added−3 removed
  • other:+4 added−1 removed

3 files+5 added−4 removed

modified:click/core.py+2 added-1 removed
941 unmodified lines
942 opts = []943 for param in self.get_params(ctx):944 rv = param.get_help_record(ctx)945 if rv is not None:946 opts.append(rv)946 part_a, part_b = rv947 opts.append((part_a, part_b.replace('\n', ' ')))948949 if opts:950 with formatter.section('Options'):951 formatter.write_dl(opts)
943 unmodified lines
modified:tests/test_options.py+1 added-3 removed
396 unmodified lines
397398 result = runner.invoke(cmd, ['--help'])399 assert result.exit_code == 0400 out = result.output.splitlines()401 assert ' --foo TEXT hello' in out402 assert ' i am' in out403 assert ' multiline' in out401 assert ' --foo TEXT hello i am multiline' in out402403def test_argument_custom_class(runner):404 class CustomArgument(click.Argument):405 def get_default(self, ctx):
118 unmodified lines
modified:CHANGES.rst+2 added
36 unmodified lines
37- Remove the unused ``mix_stderr`` parameter from38 ``CliRunner.invoke``. :issue:`1435`39- Fix ``TypeError`` raised when using bool flags and specifying40 ``type=bool``. :issue:`1287`41- Newlines in option help text are replaced with spaces before42 re-wrapping to avoid uneven line breaks. :issue:`834`434445Version 7.046-----------
540 unmodified lines