#!/usr/bin/env bash
# nerf-uv-pytest -- Run pytest with the given arguments
# Generated from uv manifest. Do not edit directly.
# nerf:threat:read=workspace
# nerf:threat:write=workspace

set -euo pipefail

_NERF_DRY_RUN=""

usage() {
  cat >&2 <<'EOF'
Usage: nerf-uv-pytest [<args...>]

Arguments:
  <args...>
      Arguments to pass to pytest (e.g. tests/ -v or -x -q)

Maps to: uv run pytest <args>

Run pytest with the given arguments.
EOF
  exit 1
}

while [[ $# -gt 0 ]]; do
  case "$1" in
    --nerf-dry-run) _NERF_DRY_RUN="true"; shift 1 ;;
    -h|--help) usage ;;
    --) shift; break ;;
    *) break ;;
  esac
done

ARGS=("$@")

if [[ "$_NERF_DRY_RUN" == "true" ]]; then
  echo "dry-run: uv run pytest ${ARGS[@]+"${ARGS[@]}"}"
  exit 0
fi

exec uv run pytest ${ARGS[@]+"${ARGS[@]}"}
