Skip to content

Commit bd48a0e

Browse files
committed
all args except 'name' must be keyword-only in optgroup decorator
1 parent 85d2869 commit bd48a0e

File tree

1 file changed

+15
-5
lines changed

1 file changed

+15
-5
lines changed

click_option_group/_decorators.py

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -67,27 +67,37 @@ def __init__(self) -> None:
6767
self._outer_frame_index = 1
6868

6969
def __call__(self,
70-
name: Optional[str] = None,
70+
name: Optional[str] = None, *,
7171
help: Optional[str] = None,
7272
cls: Optional[Type[OptionGroup]] = None, **attrs):
73+
"""Creates a new group and collects its options
74+
75+
Creates the option group and registers all grouped options
76+
which were added by `option` decorator.
77+
78+
:param name: Group name or None for deault name
79+
:param help: Group help or None for empty help
80+
:param cls: Option group class that should be inherited from `OptionGroup` class
81+
:param attrs: Additional parameters of option group class
82+
"""
7383
try:
7484
self._outer_frame_index = 2
75-
return self.group(name, cls=cls, help=help, **attrs)
85+
return self.group(name, help=help, cls=cls, **attrs)
7686
finally:
7787
self._outer_frame_index = 1
7888

7989
def group(self,
8090
name: Optional[str] = None, *,
81-
cls: Optional[Type[OptionGroup]] = None,
82-
help: Optional[str] = None, **attrs):
91+
help: Optional[str] = None,
92+
cls: Optional[Type[OptionGroup]] = None, **attrs):
8393
"""The decorator creates a new group and collects its options
8494
8595
Creates the option group and registers all grouped options
8696
which were added by `option` decorator.
8797
8898
:param name: Group name or None for deault name
89-
:param cls: Option group class that should be inherited from `OptionGroup` class
9099
:param help: Group help or None for empty help
100+
:param cls: Option group class that should be inherited from `OptionGroup` class
91101
:param attrs: Additional parameters of option group class
92102
"""
93103

0 commit comments

Comments
 (0)