docs: def mode(ctx, mode, touch_eject, autoeject_timeout, chalresp_timeout, force):
      """
      Manage connection modes (USB Interfaces).
  
      Get the current connection mode of the YubiKey, or set it to MODE.
  
      MODE can be a string, such as "OTP+FIDO+CCID", or a shortened form: "o+f+c".
      It can also be a mode number.
  
      Examples:
  
      \b
        Set the OTP and FIDO mode:
        $ ykman mode OTP+FIDO
  
      \b
        Set the CCID only mode and use touch to eject the smart card:
        $ ykman mode CCID --touch-eject
      """
      dev = ctx.obj['dev']
      if autoeject_timeout:
          touch_eject = True
      autoeject = autoeject_timeout if touch_eject else None
  
      if mode is not None:
          if mode.transports != TRANSPORT.CCID:
              autoeject = None
              if touch_eject:
                  ctx.fail('--touch-eject can only be used when setting'
                           ' CCID-only mode')
  
          if not force:
              if mode == dev.mode:
                  click.echo('Mode is already {}, nothing to do...'.format(mode))
                  ctx.exit()
              elif not dev.has_mode(mode):
                  click.echo('Mode {} is not supported on this YubiKey!'
                             .format(mode))
                  ctx.fail('Use --force to attempt to set it anyway.')
              force or click.confirm('Set mode of YubiKey to {}?'.format(mode),
                                     abort=True, err=True)
  
          try:
              dev.set_mode(mode, chalresp_timeout, autoeject)
              if not dev.can_write_config:
                  click.echo(
                      'Mode set! You must remove and re-insert your YubiKey '
                      'for this change to take effect.')
          except ModeSwitchError as e:
              logger.debug('Failed to switch mode', exc_info=e)
              click.echo('Failed to switch mode on the YubiKey. Make sure your '
                         'YubiKey does not have an access code set.')
  
      else:
          click.echo('Current connection mode is: {}'.format(dev.mode))
          supported = ', '.join(t.name for t in TRANSPORT
                                .split(dev.config.usb_supported))
          click.echo('Supported USB interfaces are: {}'.format(supported))