#!/usr/bin/env bash
set -euo pipefail

REPO_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
usage() {
    cat <<'EOF'
Usage: report-render [--title TITLE] [--details] [--only failures|warnings|problems|all] [--json]

Reads TSV rows from stdin:
  status<TAB>area<TAB>check<TAB>summary<TAB>detail<TAB>fix<TAB>graph<TAB>query

Statuses: ok, warn, fail, skip
EOF
}

if (($# > 0)); then
    case "$1" in
        -h | --help)
            usage
            exit 0
            ;;
    esac
fi

exec "${REPO_ROOT}/scripts/jeannie-core" report-render "$@"
