rich_click.patch
Patch click, Typer or asyncclick so that their commands print help and errors with rich-click.
Functions
| Name | Description |
|---|---|
patch | Patch Click internals to use rich-click types. |
patch_typer | Patch Typer so that its commands print help and errors with rich-click. |
patchfunction#
def patch(rich_config: RichHelpConfiguration | None = None, *, patch_rich_click: bool = True, patch_typer: bool = False, module: Any | None = None) -> NonePatch Click internals to use rich-click types.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
rich_config | RichHelpConfiguration | None | None | Help configuration to apply globally. |
patch_rich_click | bool | True | Also patch the rich_click namespace. Ignored when module is set. |
patch_typer | bool | False | Also patch Typer. Ignored when module is set. |
module | Any | None | None | An asynchronous click fork, such as asyncclick, to patch instead of click.
rich-click then installs its async command classes into the namespace of that module.
Requires rich-click[async]. |
Raises
TypeErrormoduleis not an asynchronous click fork, such as asyncclick.
patch_typerfunction#
def patch_typer(rich_config: RichHelpConfiguration | None = None) -> NonePatch Typer so that its commands print help and errors with rich-click.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
rich_config | RichHelpConfiguration | None | None | Help configuration for every command. |