feat: rework the --batch json output entirely

This commit is contained in:
Stéphane Lesimple
2026-04-08 20:50:54 +02:00
parent 3afbda8430
commit 39dea1245e
8 changed files with 384 additions and 20 deletions

View File

@@ -116,7 +116,7 @@ while [ -n "${1:-}" ]; do
opt_no_color=1
shift
case "$1" in
text | short | nrpe | json | prometheus)
text | short | nrpe | json | json-terse | prometheus)
opt_batch_format="$1"
shift
;;
@@ -124,7 +124,7 @@ while [ -n "${1:-}" ]; do
'') ;; # allow nothing at all
*)
echo "$0: error: unknown batch format '$1'" >&2
echo "$0: error: --batch expects a format from: text, nrpe, json" >&2
echo "$0: error: --batch expects a format from: text, nrpe, json, json-terse" >&2
exit 255
;;
esac