#!/usr/bin/env bash

brt_json() {
  local input="${1:--}"
  brt_require python3

  if [[ "$input" == "-" ]]; then
    python3 -m json.tool
  elif [[ -f "$input" ]]; then
    python3 -m json.tool "$input"
  else
    echo "$input" | python3 -m json.tool
  fi
}
