diff options
author | Fletcher Davis <fletcher.t.davis@gmail.com> | 2018-05-15 06:48:00 -0700 |
---|---|---|
committer | Fletcher Davis <fletcher.t.davis@gmail.com> | 2018-05-15 06:48:00 -0700 |
commit | 639daa4f43da2aa152c415a1bba35fa48aa87259 (patch) | |
tree | b8efc45835a463873d0aee46fae8f9cc5b921821 /tests/test_commands.py | |
parent | 1782e21d7b6dc50db522e329dcaf61b9c3a30af1 (diff) | |
download | click-639daa4f43da2aa152c415a1bba35fa48aa87259.tar.gz |
allow specify short width to address cmd formatting
try to address the too short short_help width as requested in
https://github.com/pallets/click/issues/936
Diffstat (limited to 'tests/test_commands.py')
-rw-r--r-- | tests/test_commands.py | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/tests/test_commands.py b/tests/test_commands.py index e8a9535..af58e7a 100644 --- a/tests/test_commands.py +++ b/tests/test_commands.py @@ -59,12 +59,18 @@ def test_auto_shorthelp(runner): """This is a long text that is too long to show as short help and will be truncated instead.""" + @cli.command(context_settings={'short_help_width': 20}) + def width(): + """This is a long text that is too long to show as short help + and will be truncated instead.""" + result = runner.invoke(cli, ['--help']) assert re.search( r'Commands:\n\s+' r'long\s+This is a long text that is too long to show\.\.\.\n\s+' r'short\s+This is a short text\.\n\s+' - r'special-chars\s+Login and store the token in ~/.netrc\.\s*', + r'special-chars\s+Login and store the token in ~/.netrc\.\s+' + r'width\s+This is a long text\.\.\.\n\s*', result.output) is not None |