def flag_specific_config_name(self):
        """Returns the name of the flag-specific configuration which best matches
           self._specified_additional_driver_flags(), or the first specified flag
           with leading '-'s stripped if no match in the configuration is found.
        """
        specified_flags = self._specified_additional_driver_flags()
        if not specified_flags:
            return None

        best_match = None
        configs = self._flag_specific_configs()
        for name in configs:
            # To match the specified flags must start with all config args.
            args = configs[name]
            if specified_flags[:len(args)] != args:
                continue
            # The first config matching the highest number of specified flags wins.
            if not best_match or len(configs[best_match]) < len(args):
                best_match = name

        if best_match:
            return best_match
        # If no match, fallback to the old mode: using the name of the first specified flag.
        return specified_flags[0].lstrip('-')