get the name for configuration

        This returns a name respecting commands and subcommands.  So if you
        have a command name "index" with subcommand "ls", which has option
        "--all", you will pass the action for subcommand "ls"  and the options's
        dest name ("all" in this case), then this function will return
        "index.ls.all" as configuration name for this option.

def get_config_name(self, action, name=None):
        '''get the name for configuration

        This returns a name respecting commands and subcommands.  So if you
        have a command name "index" with subcommand "ls", which has option
        "--all", you will pass the action for subcommand "ls"  and the options's
        dest name ("all" in this case), then this function will return
        "index.ls.all" as configuration name for this option.
        '''

        _name = None

        if name is None:
            if '.' in action:
                action, name = action.rsplit('.', 1)
            else:
                _name = ''
                name = action

        if _name is None:
            if isinstance(action, basestring):
                action = self.get_action(action)
            _name = action.argdeco_name

        logger.debug("_name=%s", _name)

        config_name = Undefined
        while True:
            logger.debug("check _name=%s, name=%s", repr(_name), repr(name))

            if _name in self.config_map:
                if name in self.config_map[_name]:
                    config_name = self.config_map[_name][name]
                    if config_name is not None:
                        if config_name.startswith('.'):
                            config_name = _name + config_name
                    break

            if _name == '':
                break

            if '.' not in _name:
                _name = ''
                continue

            _name = _name.rsplit('.', 1)[0]

        assert config_name is not Undefined, "could not determine config name for %s" % name
        return config_name