Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/click/formatting.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,10 @@ def write_usage(self, prog: str, args: str = "", prefix: str | None = None) -> N
usage_prefix = f"{prefix:>{self.current_indent}}{prog} "
text_width = self.width - self.current_indent

if not args:
self.write(f"{prefix:>{self.current_indent}}{prog}\n")
return

if text_width >= (term_len(usage_prefix) + 20):
# The arguments will fit to the right of the prefix.
indent = " " * term_len(usage_prefix)
Expand Down
Loading