def METHOD_NAME(original_fn, self, *args, **kwargs):
    if isinstance(self, (Command, Group)) and "name" in kwargs:
        if isinstance(self, Command):
            PatchClick._num_commands += 1
        if not running_remotely():
            name = kwargs["name"]
            if name:
                PatchClick._args[name] = False
                if isinstance(self, Command):
                    PatchClick._args_type[name] = PatchClick._command_type
                # maybe we should take it post initialization
                if kwargs.get("help"):
                    PatchClick._args_desc[name] = str(kwargs.get("help"))
            for option in kwargs.get("params") or []:
                if (
                    not option
                    or not isinstance(option, (Option, Argument))
                    or not getattr(option, "expose_value", True)
                ):
                    continue
                # store default value
                PatchClick._args[name + "/" + option.name] = str(
                    option.default or ""
                )
                # store value type
                if option.type is not None:
                    PatchClick._args_type[name + "/" + option.name] = str(
                        option.type
                    )
                # store value help
                if getattr(option, "help", None):
                    PatchClick._args_desc[name + "/" + option.name] = str(
                        option.help
                    )
    return original_fn(self, *args, **kwargs)