docs: def merge_global_settings(config, cli_options):
      # type: (dict, dict) -> None
      """Merge "global" CLI options into main config
      :param dict config: config dict
      :param dict cli_options: cli options
      """
      # check for valid version from YAML
      if (not blobxfer.util.is_none_or_empty(config) and
              ('version' not in config or
               config['version'] not in _SUPPORTED_YAML_CONFIG_VERSIONS)):
          raise ValueError('"version" not specified in YAML config or invalid')
      # get action
      action = cli_options['_action']
      if (action != TransferAction.Upload.name.lower() and
              action != TransferAction.Download.name.lower() and
              action != TransferAction.Synccopy.name.lower()):
          raise ValueError('invalid action: {}'.format(action))
      # merge credentials
      if 'azure_storage' in cli_options:
          if 'azure_storage' not in config:
              config['azure_storage'] = {}
          config['azure_storage'] = blobxfer.util.merge_dict(
              config['azure_storage'], cli_options['azure_storage'])
      if ('azure_storage' not in config or
              blobxfer.util.is_none_or_empty(config['azure_storage'])):
          raise ValueError('azure storage settings not specified')
      # create action options
      if action not in config:
          config[action] = []
      # append full specs, if they exist
      if action in cli_options:
          if 'source' in cli_options[action]:
              srcdst = {
                  'source': cli_options[action]['source'],
                  'destination': cli_options[action]['destination'],
              }
              cli_options[action].pop('source')
              cli_options[action].pop('destination')
              config[action].append(srcdst)
      # merge general and concurrency options
      if 'options' not in config:
          config['options'] = {}
      if 'concurrency' not in config['options']:
          config['options']['concurrency'] = {}
      if 'timeout' not in config['options']:
          config['options']['timeout'] = {}
      if 'proxy' not in config['options']:
          config['options']['proxy'] = {}
      options = {
          'enable_azure_storage_logger': _merge_setting(
              cli_options, config['options'], 'enable_azure_storage_logger'),
          'log_file': _merge_setting(cli_options, config['options'], 'log_file'),
          'progress_bar': _merge_setting(
              cli_options, config['options'], 'progress_bar', default=True),
          'resume_file': _merge_setting(
              cli_options, config['options'], 'resume_file'),
          'timeout': {
              # TODO deprecated timeout setting
              'timeout': _merge_setting(
                  cli_options, config['options']['timeout'], 'timeout',
                  name_cli='timeout'),
              'connect': _merge_setting(
                  cli_options, config['options']['timeout'], 'connect',
                  name_cli='connect_timeout'),
              'read': _merge_setting(
                  cli_options, config['options']['timeout'], 'read',
                  name_cli='read_timeout'),
              'max_retries': _merge_setting(
                  cli_options, config['options']['timeout'], 'max_retries',
                  default=1000),
          },
          'verbose': _merge_setting(
              cli_options, config['options'], 'verbose', default=False),
          'quiet': _merge_setting(
              cli_options, config['options'], 'quiet', default=False),
          'dry_run': _merge_setting(
              cli_options, config['options'], 'dry_run', default=False),
          'concurrency': {
              'crypto_processes': _merge_setting(
                  cli_options, config['options']['concurrency'],
                  'crypto_processes', default=0),
              'disk_threads': _merge_setting(
                  cli_options, config['options']['concurrency'],
                  'disk_threads', default=0),
              'md5_processes': _merge_setting(
                  cli_options, config['options']['concurrency'],
                  'md5_processes', default=0),
              'transfer_threads': _merge_setting(
                  cli_options, config['options']['concurrency'],
                  'transfer_threads', default=0),
          },
          'proxy': {
              'host': _merge_setting(
                  cli_options, config['options']['proxy'], 'host',
                  name_cli='proxy_host'),
              'username': _merge_setting(
                  cli_options, config['options']['proxy'], 'username',
                  name_cli='proxy_username'),
              'password': _merge_setting(
                  cli_options, config['options']['proxy'], 'password',
                  name_cli='proxy_password'),
          }
      }
      config['options'] = options