Skip to content

Commit

Permalink
Merge pull request #158 from janluke/fix/write_usage
Browse files Browse the repository at this point in the history
Fix `write usage`: formatting and default value
  • Loading branch information
janluke committed Jun 3, 2023
2 parents 864c857 + 22ac57a commit ef59d8b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions cloup/formatting/_formatter.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,10 +168,10 @@ def write(self, *strings: str) -> None:
self.buffer += strings

def write_usage(
self, prog: str, args: str = "", prefix: Optional[str] = 'Usage:'
self, prog: str, args: str = "", prefix: Optional[str] = None
) -> None:
if prefix:
prefix = self.theme.heading(prefix + ' ')
prefix = "Usage:" if prefix is None else prefix
prefix = self.theme.heading(prefix) + " "
prog = self.theme.invoked_command(prog)
super().write_usage(prog, args, prefix)

Expand Down

0 comments on commit ef59d8b

Please sign in to comment.