MCPcopy Index your code
hub / github.com/python-cmd2/cmd2 / print_usage

Method print_usage

cmd2/argparse_utils.py:644–650  ·  view source on GitHub ↗

Override to ensure the formatter is aware of the target file.

(self, file: IO[str] | None = None)

Source from the content-addressed store, hash-verified

642 self.epilog: HelpContent | None # type: ignore[assignment]
643
644 def print_usage(self, file: IO[str] | None = None) -> None: # type:ignore[override]
645 """Override to ensure the formatter is aware of the target file."""
646 if file is None:
647 file = self._thread_locals.current_output_file
648
649 with self.output_to(file):
650 super().print_usage(file)
651
652 def print_help(self, file: IO[str] | None = None) -> None: # type:ignore[override]
653 """Override to ensure the formatter is aware of the target file."""

Callers 3

errorMethod · 0.95
errorMethod · 0.80

Calls 1

output_toMethod · 0.95

Tested by 1