print_default() {
  printf '%b\n' "$*"
}

print_info() {
  printf '%b\n' "\e[1;36m$*\e[m" # cyan
}

print_notice() {
  printf '%b\n' "\e[1;35m$*\e[m" # magenta
}

print_success() {
  printf '%b\n' "\e[1;32m$*\e[m" # green
}

print_warning() {
  printf '%b\n' "\e[1;33m$*\e[m" # yellow
}

print_error() {
  printf '%b\n' "\e[1;31m$*\e[m" # red
}

print_debug() {
  printf '%b\n' "\e[1;34m$*\e[m" # blue
}

chkcmd() {
  if ! builtin command -v "$1"; then
    print_error "${1} command not found"
    exit
  fi
}

yes_or_no_select() {
  print_notice "Are you ready? [yes/no]"
  read -r ans
  case ${ans} in
    yes | y)
      return 0
      ;;
    no | n)
      return 1
      ;;
    *)
      yes_or_no_select
      ;;
  esac
}

if yes_or_no_select "Are you ready for starting install?"; then
  echo foo
else
  exit 1
fi
# read -r -n 1 -p "$1 (y/n) " ans
# echo ""
# test "$ans" = "y"
