support command groups
Hi there! I just came across this repo and find it very interesting. I have a use case in which I have multiple similar scenarios. Each scenario needs a CLI that shares a lot of behavior between the different use cases. Further, I'm using a command group. Basically the shared behavior should look like this:
from abc import ABC, abstractmethod
import objclick as click
class MyCliBase(ABC):
@click.group()
def cli(self):
pass
@cli.command
@abstractmethod
def my_command(self, **kwargs):
raise NotImplementedError()
And the specific one like this:
# ...
class MySpecificCli(MyCliBase):
@click.option("--some-option")
def my_command(self, **kwargs):
print(kwargs["some_option"])
# call some other methods from parent
In this case, some-option
is not recognized.
My assumption would be that the @cli.command
context is missing or not set up correctly.
So the question is: How can I use such a setup?