#!/usr/bin/bash

set -euo pipefail

case "${1:-}" in
    --version) printf '%s\n' "${PANAMA_DOCTOR_FIXTURE_QS_VERSION:-Quickshell 0.2.0}" ;;
    list)
        case ",${PANAMA_DOCTOR_FIXTURE_PROCESSES:-}," in
            *,qs:duplicate,*) printf '%s\n' 'Instance fixture-one:' 'Instance fixture-two:' ;;
            *,qs:missing,*) ;;
            *) printf '%s\n' 'Instance fixture-one:' ;;
        esac
        ;;
    ipc)
        if [[ "${PANAMA_DOCTOR_FIXTURE_QS:-ready}" == "malformed" ]]; then
            printf 'fixture-secret-token AA:BB:CC:DD:EE:FF\n'
        else
            printf '%s\n' 'target notifications' 'target clipboard' 'target wallpaper' 'target capture'
        fi
        ;;
    *) exit 2 ;;
esac
