docs: def add_command(self, func, name=None, doc=None):
          """
          Add a command function to the registry.
  
          :param func: command function.
          :param name: default name of func.
          :param doc: description of the func.default docstring of func.
  
          """
          command = Command(func, doc)
          name = name or func.__name__
          self._commands[name] = command