Skip to content

Commit

Permalink
Don't truncate long metavars.
Browse files Browse the repository at this point in the history
Fixes #33
  • Loading branch information
ewels committed Mar 3, 2022
1 parent 66b584c commit 27574a0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

## Version 1.2.2.dev0

- Change metavar overflow to `fold`, so that large numbers of choices flow onto new lines instead of being truncated with an ellipsis [[#33](https://github.com/ewels/rich-click/issues/33)]

## Version 1.2.1 (2022-03-02)

- Support the command `short_help` argument [[#28](https://github.com/ewels/rich-click/issues/28)]
Expand Down
3 changes: 2 additions & 1 deletion src/rich_click/rich_click.py
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,7 @@ def _get_parameter_help(param, ctx):
Text(
APPEND_METAVARS_HELP_STRING.format(metavar_str),
style=STYLE_METAVAR_APPEND,
overflow="fold",
)
)

Expand Down Expand Up @@ -364,7 +365,7 @@ def rich_format_help(obj, ctx, formatter):
opt_short_strs.append(opt_str)

# Column for a metavar, if we have one
metavar = Text(style=STYLE_METAVAR)
metavar = Text(style=STYLE_METAVAR, overflow="fold")
metavar_str = param.make_metavar()
# Do it ourselves if this is a positional argument
if type(param) is click.core.Argument and metavar_str == param.name.upper():
Expand Down

0 comments on commit 27574a0

Please sign in to comment.