Skip to content

Commit cb1a84f

Browse files
committed
clear opts and secondary_opts for fake options
For example it is workaround for correct click-repl
1 parent b7a2608 commit cb1a84f

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

click_option_group/_core.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,11 @@ def __init__(self, param_decls=None, *, group: 'OptionGroup', **attrs):
7272
self.__group = group
7373
super().__init__(param_decls, hidden=True, expose_value=False, help=group.help, **attrs)
7474

75+
# We remove parsed opts for the fake options just in case.
76+
# For example it is workaround for correct click-repl autocomplete
77+
self.opts = []
78+
self.secondary_opts = []
79+
7580
def get_help_record(self, ctx: click.Context):
7681
return self.__group.get_help_record(ctx)
7782

0 commit comments

Comments
 (0)