docs: def nfc(ctx, enable, disable, enable_all, disable_all, list, lock_code, force):
      """
      Enable or disable applications over NFC.
      """
  
      if not (list or enable_all or enable or disable_all or disable):
          ctx.fail('No configuration options chosen.')
  
      if enable_all:
          enable = APPLICATION.__members__.keys()
  
      if disable_all:
          disable = APPLICATION.__members__.keys()
  
      _ensure_not_invalid_options(ctx, enable, disable)
  
      dev = ctx.obj['dev']
      nfc_supported = dev.config.nfc_supported
      nfc_enabled = dev.config.nfc_enabled
  
      if not nfc_supported:
          ctx.fail('NFC interface not available.')
  
      if list:
          _list_apps(ctx, nfc_enabled)
  
      for app in enable:
          if APPLICATION[app] & nfc_supported:
              nfc_enabled |= APPLICATION[app]
          else:
              ctx.fail('{} not supported over NFC.'.format(app))
      for app in disable:
          if APPLICATION[app] & nfc_supported:
              nfc_enabled &= ~APPLICATION[app]
          else:
              ctx.fail('{} not supported over NFC.'.format(app))
  
      f_confirm = '{}{}Configure NFC interface?'.format(
          'Enable {}.\n'.format(
              ', '.join(
                  [str(APPLICATION[app]) for app in enable])) if enable else '',
          'Disable {}.\n'.format(
              ', '.join(
                  [str(APPLICATION[app]) for app in disable])) if disable else '')
  
      is_locked = dev.config.configuration_locked
  
      if force and is_locked and not lock_code:
          ctx.fail('Configuration is locked - please supply the --lock-code '
                   'option.')
      if lock_code and not is_locked:
          ctx.fail('Configuration is not locked - please remove the '
                   '--lock-code option.')
  
      force or click.confirm(f_confirm, abort=True, err=True)
  
      if is_locked and not lock_code:
          lock_code = prompt_lock_code()
  
      if lock_code:
          lock_code = _parse_lock_code(ctx, lock_code)
  
      try:
          dev.write_config(
              device_config(
                  nfc_enabled=nfc_enabled),
              reboot=True, lock_key=lock_code)
      except Exception as e:
          logger.error('Failed to write config', exc_info=e)
          ctx.fail('Failed to configure NFC applications.')