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 452591a, 35044bd · Browse files · 3 files+15 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+15 added−1 removed

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

3 files+15 added−1 removed

modified:click/parser.py+1 added-1 removed
312 unmodified lines
313 option = self._short_opt.get(opt)314 i += 1315316 if not option:317 self._error('no such option: %s' % opt)317 self._error('no such option: %s' % (arg if arg.startswith('--') else opt))318 if option.takes_value:319 # Any characters left in arg? Pretend they're the320 # next arg, and stop consuming characters of arg.321 if i < len(arg):
26 unmodified lines
modified:tests/test_options.py+12 added
1# -*- coding: utf-8 -*-2import re3import os4import click5import pytest678def test_prefixes(runner):9 @click.command()
31 unmodified lines
41 assert not result.exception42 assert result.output == 'verbosity=0\n'434445@pytest.mark.parametrize('unknown_flag', ['--foo', '-f'])46def test_unknown_options(runner, unknown_flag):47 @click.command()48 def cli():49 pass5051 result = runner.invoke(cli, [unknown_flag])52 assert result.exception53 assert 'no such option: {0}'.format(unknown_flag) in result.output545556def test_multiple_required(runner):57 @click.command()58 @click.option('-m', '--message', multiple=True, required=True)59 def cli(message):
144 unmodified lines
modified:CHANGES+2 added
14 unmodified lines
15 characters wide instead of 7916- use colorama win32 bindings if available to get the correct17 dimensions of a windows terminal.18- fixed an issue with custom function types on Python 3.19- fixed an issue with unknown options being incorrectly reported20 in error messages.2122Version 2.023-----------24
53 unmodified lines