#! /bin/sh
set -euf

cac-listservers \
  | jq \
    --arg k "$1" \
    --arg v "$2" \
    '
      map(select(.[$k]==$v)) |
      if (. | length) == 0 then
        null
      elif (. | length) == 1 then
        .[0]
      else
        .
      end
    '