Skip to content

Commit 2dcbb2d

Browse files
authored
Properly trim whitespace from the usage string (#83)
1 parent a614ab6 commit 2dcbb2d

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
1313
### Fixed
1414

1515
- Remove explicit reference to `click.BaseCommand` and `click.MultiCommand` objects in anticipation of their deprecation. (Pull #82)
16+
- Properly ensure whitespace is trimmed from the usage string. (Pull #83)
1617

1718
## 0.8.1 - 2023-09-18
1819

mkdocs_click/_docs.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ def _make_usage(ctx: click.Context) -> Iterator[str]:
193193
formatter = ctx.make_formatter()
194194
pieces = ctx.command.collect_usage_pieces(ctx)
195195
formatter.write_usage(ctx.command_path, " ".join(pieces), prefix="")
196-
usage = formatter.getvalue().rstrip("\n")
196+
usage = formatter.getvalue().strip()
197197

198198
yield "**Usage:**"
199199
yield ""

0 commit comments

Comments
 (0)