You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

35 lines
724 B

1 year ago
  1. if test -t 1; then
  2. if [ $(command -v tput) ]; then
  3. ncolors=$(tput colors)
  4. if test -n "$ncolors" && test $ncolors -ge 8; then
  5. bold="$(tput bold)"
  6. underline="$(tput smul)"
  7. standout="$(tput smso)"
  8. normal="$(tput sgr0)"
  9. black="$(tput setaf 0)"
  10. red="$(tput setaf 1)"
  11. green="$(tput setaf 2)"
  12. yellow="$(tput setaf 3)"
  13. blue="$(tput setaf 4)"
  14. magenta="$(tput setaf 5)"
  15. cyan="$(tput setaf 6)"
  16. white="$(tput setaf 7)"
  17. fi
  18. fi
  19. fi
  20. info() {
  21. printf "${green}[INFO ]${normal} $1\n"
  22. }
  23. warning() {
  24. printf "${red}[WARNING]${normal} $1\n"
  25. }
  26. error() {
  27. printf "${standout}${red}[ERROR ]${normal} $1\n"
  28. }
  29. indent() {
  30. printf " $1\n"
  31. }