#!/usr/bin/env bash
# Show host ports and the env URLs that must stay aligned with them.
source "$(dirname "${BASH_SOURCE[0]}")/common.sh"

usage() {
  cat <<EOF
Usage: ${RUN_CMD:-run-stack} ports [--show]

  --show, -s   Print ports + env URL tables (default)
  -h, --help   Show this help

Edit ports in .run/run.config.json / .run/.env, then update matching
VITE_* / EXPO_PUBLIC_* URLs (or re-run init).
EOF
}

case "${1:-}" in
  ""|--show|-s)
    ensure_env
    print_ports_recap
    ;;
  -h|--help|help)
    usage
    ;;
  *)
    echo "unknown option: $1" >&2
    usage >&2
    exit 1
    ;;
esac
