#!/usr/bin/env bash
# klasp-plugin-fixture — test fixture for integration tests of `klasp plugins`.
# Responds to --describe and --gate per the v0 plugin protocol.
set -euo pipefail

if [[ "${1:-}" == "--describe" ]]; then
    printf '{"protocol_version":0,"name":"klasp-plugin-fixture","config_types":["fixture"],"supports":{"verdict_v0":true}}\n'
    exit 0
fi

if [[ "${1:-}" == "--gate" ]]; then
    cat > /dev/null
    printf '{"protocol_version":0,"verdict":"pass","findings":[]}\n'
    exit 0
fi

echo "unknown subcommand: ${1:-}" >&2
exit 1
