We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
This might be a bit tricky to implement, but would be nice to have:
@click.command @optgroup.group('My group', 'my_group') @optgroup.option('--foo') @optgroup.option('--bar') @click.option('--click-option') def my_func(my_group,click_option): pass
I.e. access the whole group as a dict my_group. A hacky workaround would be:
my_group
def _my_group(func): """Select group options""" @optgroup.group('My group'') @optgroup.option('--foo') @optgroup.option('--bar') @functools.wraps(func) def wrapper(*args, **kwargs): my_group = { opt: kwargs.pop(opt) for opt in ('foo', 'bar') } return func(*args, my_group=my_group, **kwargs) return wrapper @click.command @_my_group @click.option('--click-option') def my_func(my_group,click_option): pass
Probably this can be adapted for proper implementation
The text was updated successfully, but these errors were encountered:
I am looking for this too, tried to see if I could do something with handle_parse_result and set the result on the context, but your hack seems better
Sorry, something went wrong.
Hello guys, I don't mind. PRs are welcome :)
No branches or pull requests
This might be a bit tricky to implement, but would be nice to have:
I.e. access the whole group as a dict
my_group
. A hacky workaround would be:Probably this can be adapted for proper implementation
The text was updated successfully, but these errors were encountered: