Decorator to add a command function to the registry.

        :param func: command function.

def command(self, func):
        """
        Decorator to add a command function to the registry.

        :param func: command function.

        """
        command = Command(func)
        self._commands[func.__name__] = command
        return func