revert adding space between option help
Before adoption: this commit came in with the history the project adopted, so no landing records it.
authored by David Lord · committed by David Lord · parent 9330dba · Browse files · 3 files·+2 added−40 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+2 added−40 removed
- tests:+0 added−36 removed
- other:+2 added−4 removed
Provenance
- Commit
bc21607- Tree
67da053- Author
David Lord <davidism@gmail.com>- Committer
David Lord <davidism@gmail.com>- Parent
9330dba
3 files changed+2 added−40 removed
modified:src/click/formatting.py-4 removed
223 unmodified lines224 self.write(f"{lines[0]}\n")225 226 for line in lines[1:]:227 self.write(f"{'':>{first_col + self.current_indent}}{line}\n")228-229- if len(lines) > 1:230- # separate long help from next option231- self.write("\n")228 else:229 self.write("\n")230 231 @contextmanager46 unmodified linesmodified:tests/test_formatting.py-36 removed
329 unmodified lines330 " --help Show this message and exit. [default: False]",331 ]332 333 334-def test_formatting_usage_multiline_option_padding(runner):335- @click.command("foo")336- @click.option("--bar", help="This help message will be padded if it wraps.")337- def cli():338- pass339-340- result = runner.invoke(cli, "--help", terminal_width=45)341- assert not result.exception342- assert result.output.splitlines() == [343- "Usage: foo [OPTIONS]",344- "",345- "Options:",346- " --bar TEXT This help message will be",347- " padded if it wraps.",348- "",349- " --help Show this message and exit.",350- ]351-352-353-def test_formatting_usage_no_option_padding(runner):354- @click.command("foo")355- @click.option("--bar", help="This help message will be padded if it wraps.")356- def cli():357- pass358-359- result = runner.invoke(cli, "--help", terminal_width=80)360- assert not result.exception361- assert result.output.splitlines() == [362- "Usage: foo [OPTIONS]",363- "",364- "Options:",365- " --bar TEXT This help message will be padded if it wraps.",366- " --help Show this message and exit.",367- ]368-369-334 def test_formatting_with_options_metavar_empty(runner):335 cli = click.Command("cli", options_metavar="", params=[click.Argument(["var"])])336 result = runner.invoke(cli, ["--help"])337 assert "Usage: cli VAR\n" in result.outputmodified:CHANGES.rst+2 added
147 unmodified lines148 ``is_flag=False``, and the value can instead be prompted for or149 passed in as a default value.150 :issue:`549, 736, 764, 921, 1015, 1618`151 - Fix formatting when ``Command.options_metavar`` is empty. :pr:`1551`152+- Revert adding space between option help text that wraps.153+ :issue:`1831`154 - The default value passed to ``prompt`` will be cast to the correct155 type like an input value would be. :pr:`1517`156 - Automatically generated short help messages will stop at the first157 ending of a phrase or double linebreak. :issue:`1082`680 unmodified lines