cac-get-server-by: no match -> return null

This commit is contained in:
tv 2015-05-21 02:47:10 +02:00
parent 8ff3a49978
commit d41e3a5577

View File

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