Skip to content

How to use multiple custom click group classes? #262

Description

@ssbarnea

First check

I wanted to use two click plugins in parallel but adding my CustomTyper(typer.Typer) class allows me to specify only one class to use.

Description

from click_help_colors import HelpColorsCommand, HelpColorsGroup
from click_didyoumean import DYMGroup


class CustomTyper(typer.Typer):
    def __init__(
        self,
        *args,
        cls=DYMGroup,  # <-- i can specify just a single class here
        context_settings={"help_option_names": ["-h", "--help"]},
        **kwargs
    ) -> None:
        super().__init__(*args, cls=cls, context_settings=context_settings, **kwargs)

Is it possible to [...]?

Additional context

I also tried to add another CustomGroup class that inherits from both but it did not had the desired effect as some methods shadows the ones from the other class.

Are such click plugins mutually exclusive or is a way to make use of them in parallel?

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionQuestion or problem

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions