Skip to content

Commit c45b74c

Browse files
authored
Merge pull request #16 from click-contrib/fix-click-repl-autocomplete
clear opts and secondary_opts for fake options
2 parents b7a2608 + cb1a84f commit c45b74c

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)