diff --git a/aiida/cmdline/commands/cmd_code.py b/aiida/cmdline/commands/cmd_code.py index 860ae56bdf..eee6b2901c 100644 --- a/aiida/cmdline/commands/cmd_code.py +++ b/aiida/cmdline/commands/cmd_code.py @@ -29,7 +29,7 @@ def verdi_code(): """Setup and manage codes.""" -def create_code(cls, non_interactive, **kwargs): # pylint: disable=unused-argument +def create_code(ctx: click.Context, cls, non_interactive: bool, **kwargs): # pylint: disable=unused-argument """Create a new `Code` instance.""" try: instance = cls(**kwargs) diff --git a/aiida/cmdline/groups/dynamic.py b/aiida/cmdline/groups/dynamic.py index 623d56140c..2cadef85e1 100644 --- a/aiida/cmdline/groups/dynamic.py +++ b/aiida/cmdline/groups/dynamic.py @@ -68,15 +68,15 @@ def get_command(self, ctx, cmd_name): :returns: The :class:`click.Command`. """ try: - command = self.create_command(cmd_name) + command = self.create_command(ctx, cmd_name) except exceptions.EntryPointError: command = super().get_command(ctx, cmd_name) return command - def create_command(self, entry_point): + def create_command(self, ctx, entry_point): """Create a subcommand for the given ``entry_point``.""" cls = self.factory(entry_point) - command = functools.partial(self.command, cls) + command = functools.partial(self.command, ctx, cls) command.__doc__ = cls.__doc__ return click.command(entry_point)(self.create_options(entry_point)(command))