docs: def list_keys(ctx, serials, readers):
      """
      List connected YubiKeys.
      """
      if readers:
          for reader in list_readers():
              click.echo(reader.name)
          ctx.exit()
  
      all_descriptors = get_descriptors()
      descriptors = [d for d in all_descriptors if d.key_type != YUBIKEY.SKY]
      skys = len(all_descriptors) - len(descriptors)
      handled_serials = set()
      for dev in list_devices():
          handled = False
          if skys > 0 and dev.key_type == YUBIKEY.SKY:
              skys -= 1
              serial = None
              handled = True
          else:
              serial = dev.serial
              if serial not in handled_serials:
                  handled_serials.add(serial)
                  matches = [d for d in descriptors if (d.key_type, d.mode)
                             == (dev.driver.key_type, dev.driver.mode)]
                  if len(matches) > 0:
                      d = matches[0]
                      descriptors.remove(d)
                      handled = True
          if handled:
              if serials:
                  if serial:
                      click.echo(serial)
              else:
                  click.echo('{} [{}]{}'.format(
                      dev.device_name,
                      dev.mode,
                      ' Serial: {}'.format(serial) if serial else '')
                  )
          dev.close()
          if not descriptors and not skys:
              break