code: def config_default(option, default=None, type=None, section=cli.name):
      
      def f(option=option, default=default, type=type, section=section):
          config = read_config()
          if type is None and default is not None:
              # detect type from default.
              type = builtins.type(default)
          get_option = option_getter(type)
          try:
              return get_option(config, section, option)
          except (NoOptionError, NoSectionError):
              return default
      return f
docs: Guesses a default value of a CLI option from the configuration.
  
      ::
  
         @click.option('--locale', default=config_default('locale'))