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

Method __init__

cmd2/rich_utils.py:123–142  ·  view source on GitHub ↗

Initialize Cmd2HelpFormatter.

(
        self,
        prog: str,
        indent_increment: int = 2,
        max_help_position: int = 24,
        width: int | None = None,
        *,
        file: IO[str] | None = None,
        console: "Cmd2RichArgparseConsole | None" = None,
        **kwargs: Any,
    )

Source from the content-addressed store, hash-verified

121 text_markup: ClassVar[bool] = False
122
123 def __init__(
124 self,
125 prog: str,
126 indent_increment: int = 2,
127 max_help_position: int = 24,
128 width: int | None = None,
129 *,
130 file: IO[str] | None = None,
131 console: "Cmd2RichArgparseConsole | None" = None,
132 **kwargs: Any,
133 ) -> None:
134 """Initialize Cmd2HelpFormatter."""
135 if file is not None and console is not None:
136 raise TypeError("cannot provide both 'file' and 'console' arguments")
137
138 self._file = file
139 super().__init__(prog, indent_increment, max_help_position, width, console=console, **kwargs)
140
141 # Recast to assist type checkers
142 self._console: Cmd2RichArgparseConsole | None
143
144 @property # type: ignore[override]
145 def console(self) -> "Cmd2RichArgparseConsole":

Callers

nothing calls this directly

Calls 1

__init__Method · 0.45

Tested by

no test coverage detected