'Implement all menu commands.'

def func(self):

    def _restore(caller):
        saved_options = caller.attributes.get('_menutree_saved')
        if saved_options:
            startnode_tuple = caller.attributes.get('_menutree_saved_startnode')
            try:
                (startnode, startnode_input) = startnode_tuple
            except ValueError:
                (startnode, startnode_input) = (startnode_tuple, '')
            if startnode:
                saved_options[1]['startnode'] = startnode
                saved_options[1]['startnode_input'] = startnode_input
            EvMenu(caller, *saved_options[0], **saved_options[1])
            return True
        return None
    caller = self.caller
    menu = caller.ndb._menutree
    if (not menu):
        if _restore(caller):
            return
        orig_caller = caller
        caller = (caller.player if hasattr(caller, 'player') else None)
        menu = (caller.ndb._menutree if caller else None)
        if (not menu):
            if (caller and _restore(caller)):
                return
            caller = self.session
            menu = caller.ndb._menutree
            if (not menu):
                err = ('Menu    object    not    found    as    %s.ndb._menutree!' % orig_caller)
                orig_caller.msg(err)
                raise EvMenuError(err)
    caller.ndb._menutree._session = self.session
    menu._input_parser(menu, self.raw_string, caller)
