Skip to content
Myr

Fix indentation of option help

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

Fix #122

authored by Markus Unterwaditzer · committed by Markus Unterwaditzer · parent 7d776de · Browse files · 2 files+22 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

2 files+22 added−0 removed

  • tests:+20 added−0 removed
  • other:+2 added−0 removed

2 files+22 added−0 removed

modified:click/decorators.py+2 added
148 unmodified lines
149 :class:`Option` instance manually and attaching it to the150 :attr:`Command.params` list.151 """152 def decorator(f):153 if 'help' in attrs:154 attrs['help'] = inspect.cleandoc(attrs['help'])155 _param_memo(f, Option(param_decls, **attrs))156 return f157 return decorator158
131 unmodified lines
modified:tests/test_options.py+20 added
167 unmodified lines
168 result = runner.invoke(cmd)169 assert result.exit_code == 2170 assert 'Error: Missing option "--foo". Choose from foo, bar.' \171 in result.output172173174def test_multiline_help(runner):175 @click.command()176 @click.option('--foo', help="""177 hello178179 i am180181 multiline182 """)183 def cmd(foo):184 click.echo(foo)185186 result = runner.invoke(cmd, ['--help'])187 assert result.exit_code == 0188 out = result.output.splitlines()189 assert ' --foo TEXT hello' in out190 assert ' i am' in out191 assert ' multiline' in out