Hi!
In my current project, I have my own subclass of click.Command where I pre-initialise a bunch of options in self.params.
class MyCommand(click.Command):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
self.params = [
click.Option(("-a", "--A"), ...),
click.Option(("-b", "--B"), ...),
click.Option(("-c", "--C"), ...),
] + self.params
This list takes param objects and I was wondering if it's possible to instantiate an option group in this fashion without using the decorators? Have been peeking at the source here but wasn't able to find a way
Thanks!
Hi!
In my current project, I have my own subclass of
click.Commandwhere I pre-initialise a bunch of options inself.params.This list takes param objects and I was wondering if it's possible to instantiate an option group in this fashion without using the decorators? Have been peeking at the source here but wasn't able to find a way
Thanks!