<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 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