#!/usr/bin/env bash

brt_weather() {
  local location="${*:-}"
  brt_require curl

  if [[ -z "$location" ]]; then
    brt_info "Weather (auto-detect location):"
    curl -fsSL "wttr.in?format=3"
  else
    brt_info "Weather for ${location}:"
    curl -fsSL "wttr.in/${location// /+}?format=3"
  fi
  echo
}
