#!/bin/sh

# Wrapper script hinting users to move to moor. This script will be removed in
# some future release.
#
# Ref: https://github.com/walles/moor/pull/305
#
# Script authored by https://chat.mistral.ai/, colors and all.

# ANSI color codes
RED="$(printf '\033[0;31m')"
GREEN="$(printf '\033[0;32m')"
YELLOW="$(printf '\033[1;33m')"
NC="$(printf '\033[0m')" # No Color

printf "%s\n" \
	"${YELLOW}Notice:${NC} '${RED}moar${NC}' has been renamed to '${GREEN}moor${NC}', but is otherwise the same tool.${NC}" \
	"" \
	"More info here:" \
	"${GREEN}https://github.com/walles/moor/releases/tag/v2.0.0${NC}" \
	"" \
	"Please update your scripts and command line usage." \
	"${YELLOW}1.${NC} Use '${GREEN}moor${NC}' instead of '${RED}moar${NC}' on the command line." \
	"${YELLOW}2.${NC} Rename any '${RED}MOAR${NC}' environment variables to '${GREEN}MOOR${NC}'." \
	"${YELLOW}3.${NC} If your '${RED}PAGER${NC}' environment variable is set to '${RED}moar${NC}', update it to '${GREEN}moor${NC}'." \
	"${YELLOW}4.${NC} Update any custom scripts or aliases that reference '${RED}moar${NC}'." \
	"${YELLOW}This wrapper script will be removed in a future release. Thank you for using '${GREEN}moor${NC}'!${NC}" >&2

# Execute moor with all passed arguments
exec moor "$@"
