Skip to content
Myr

Merge branch '2.x-maintenance'

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

authored by Armin Ronacher · committed by Armin Ronacher · parents 98ccc9d, bb7b2df · Browse files · 3 files+11 added−1 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+11 added−1 removed

  • tests:+3 added−0 removed
  • other:+8 added−1 removed

3 files+11 added−1 removed

modified:click/core.py+1 added-1 removed
1203 unmodified lines
1204 def _write_opts(opts):1205 rv, any_slashes = join_options(opts)1206 if any_slashes:1207 any_prefix_is_slash[:] = [True]1208 if not self.is_flag:1208 if not self.is_flag and not self.count:1209 rv += ' ' + self.make_metavar()1210 return rv12111212 rv = [_write_opts(self.opts)]
124 unmodified lines
modified:tests/test_options.py+3 added
52 unmodified lines
53 result = runner.invoke(cli, [])54 assert not result.exception55 assert result.output == 'verbosity=0\n'5657 result = runner.invoke(cli, ['--help'])58 assert re.search('-v\s+Verbosity', result.output) is not None596061@pytest.mark.parametrize('unknown_flag', ['--foo', '-f'])62def test_unknown_options(runner, unknown_flag):63 @click.command()64 def cli():
155 unmodified lines
modified:CHANGES+7 added
20 unmodified lines
21 now, Click will give an error message instead of silently22 passing. This should catch situations where users wanted to23 created arguments instead of options.2425Version 2.326-----------2728(bugfix release, release date to be decided)2930- Fixed an incorrectly formatted help record for count options.'3132Version 2.233-----------3435(bugfix release, released on June 26th 2014)
77 unmodified lines