Skip to content

Commit 2788a59

Browse files
committed
Move to static method
1 parent 1f53bd4 commit 2788a59

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

easybuild/cli/options/__init__.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,6 @@ def add_group_parser(self, opt_dict, descr, *args, prefix='', **kwargs):
2626

2727
extracter = OptionExtracter(go_args=[])
2828

29-
def register_hidden_param(ctx, param, value):
30-
"""Register a hidden parameter in the context."""
31-
if not hasattr(ctx, 'hidden_params'):
32-
ctx.hidden_params = {}
33-
ctx.hidden_params[param.name] = value
3429

3530
@dataclass
3631
class OptionData:
@@ -75,10 +70,17 @@ def to_click_option_dec(self):
7570
return click.option(
7671
*decls,
7772
expose_value=False,
78-
callback=register_hidden_param,
73+
callback=self.register_hidden_param,
7974
**kwargs
8075
)
8176

77+
@staticmethod
78+
def register_hidden_param(ctx, param, value):
79+
"""Register a hidden parameter in the context."""
80+
if not hasattr(ctx, 'hidden_params'):
81+
ctx.hidden_params = {}
82+
ctx.hidden_params[param.name] = value
83+
8284
class EasyBuildCliOption():
8385
OPTIONS: list[OptionData] = []
8486
OPTIONS_MAP: dict[str, OptionData] = {}

0 commit comments

Comments
 (0)