package esr

import (
	"fmt"
	"os"
)

func Die(format string, v ...interface{}) {
	fmt.Fprintf(os.Stderr, format, v...)
	os.Stderr.Write([]byte("\n"))
	os.Exit(1)
}

func ShowHelpMessage() {
	fmt.Println(`Usage:
  esr [init] [--config <path>] [--serve] [--build] [--watch] <entrypoint>`)
}

func EnterAltScreen() {
	fmt.Print("\033[?1049h")
}

func ExitAltScreen() {
	fmt.Print("\033[?1049l")
}

func ClearScreen() {
	fmt.Print("\033[H\033[2J")
}
