code: def cliconfig(fp, env=None):
      
      if fp is None:
          raise SystemExit('No configuration file is given.')
      from clitool.config import ConfigLoader
      loader = ConfigLoader(fp)
      cfg = loader.load(env)
      if not fp.closed:
          fp.close()
      if not cfg:
          logging.warn('Configuration may be empty.')
      return cfg
docs: Load configuration data.
      Given pointer is closed internally.
      If ``None`` is given, force to exit.
  
      More detailed information is available on underlying feature,
      :mod:`clitool.config`.
  
      :param fp: opened file pointer of configuration
      :type fp: FileType
      :param env: environment to load
      :type env: str
      :rtype: dict