From 63b9ff2fa5395685e2508596847a6a7ba19937ce Mon Sep 17 00:00:00 2001 From: Alexander Reynolds Date: Fri, 13 Sep 2024 13:33:14 -0400 Subject: [PATCH] pass through context_settings to new context --- mkdocs_click/_docs.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/mkdocs_click/_docs.py b/mkdocs_click/_docs.py index d9a26bc..b6741db 100644 --- a/mkdocs_click/_docs.py +++ b/mkdocs_click/_docs.py @@ -92,7 +92,9 @@ def _recursively_make_command_docs( def _build_command_context( prog_name: str, command: click.BaseCommand, parent: click.Context | None ) -> click.Context: - return click.Context(cast(click.Command, command), info_name=prog_name, parent=parent) + return click.Context( + cast(click.Command, command), info_name=prog_name, parent=parent, **command.context_settings + ) def _get_sub_commands(command: click.Command, ctx: click.Context) -> list[click.Command]: