-
Notifications
You must be signed in to change notification settings - Fork 0
/
.pretty_print
108 lines (91 loc) · 1.53 KB
/
.pretty_print
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
have_tty()
{
# return success if both stdin and stdout are tty
local ret=1
if [[ -t 0 && -t 1 ]] ; then
ret=0
fi
return "$ret"
}
# some colors
_NC=""
_RED=""
_BRED=""
_URED=""
_GREEN=""
_BGREEN=""
_UGREEN=""
_YELLOW=""
_BYELLOW=""
_UYELLOW=""
_BLUE=""
_BBLUE=""
_PURPLE=""
_BPURPLE=""
_UPURPLE=""
_CYAN=""
_BCYAN=""
_UCYAN=""
_BOLD=""
_UND=""
if have_tty ; then
_NC='\033[0m'
_RED='\033[0;31m'
_BRED='\033[1;31m'
_URED='\033[4;31m'
_GREEN='\033[0;32m'
_BGREEN='\033[1;32m'
_UGREEN='\033[4;32m'
_YELLOW='\033[0;33m'
_BYELLOW='\033[1;33m'
_UYELLOW='\033[4;33m'
_BLUE='\033[0;34m'
_BBLUE='\033[1;34m'
_PURPLE='\033[0;35m'
_BPURPLE='\033[1;35m'
_UPURPLE='\033[4;35m'
_CYAN='\033[0;36m'
_BCYAN='\033[1;36m'
_UCYAN='\033[4;36m'
_BOLD='\033[1m'
_UND='\033[4m'
fi
print_bold() {
echo -e "${_BOLD}${*}${_NC}"
}
print_und() {
echo -e "${_UND}${*}${_NC}"
}
print_boldund() {
echo -e "${_BOLD}${_UND}${*}${_NC}"
}
print_red() {
echo -e "${_RED}${*}${_NC}"
}
print_bred() {
echo -e "${_BRED}${*}${_NC}"
}
print_green() {
echo -e "${_GREEN}${*}${_NC}"
}
print_bgreen() {
echo -e "${_BGREEN}${*}${_NC}"
}
print_yellow() {
echo -e "${_YELLOW}${*}${_NC}"
}
print_byellow() {
echo -e "${_BYELLOW}${*}${_NC}"
}
print_blue() {
echo -e "${_BLUE}${*}${_NC}"
}
print_bblue() {
echo -e "${_BBLUE}${*}${_NC}"
}
print_purple() {
echo -e "${_PURPLE}${*}${_NC}"
}
print_bpurple() {
echo -e "${_BPURPLE}${*}${_NC}"
}