-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdemo.sh
More file actions
executable file
·55 lines (45 loc) · 2.6 KB
/
demo.sh
File metadata and controls
executable file
·55 lines (45 loc) · 2.6 KB
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
#!/bin/bash
set -o nounset
set -o errexit
# 获取当前文件目录
readonly ROOT=$(cd "$(dirname "$0")"; pwd)
# 引入 highlight.sh
. ${ROOT}/highlight.sh
# 设置一项
highlight --str "Talk is cheap. Show me the code."
highlight --str "Talk is cheap. Show me the code." --color 2
highlight --str "Talk is cheap. Show me the code." --bgcolor 5
highlight --str "Talk is cheap. Show me the code." --bold 1
highlight --str "Talk is cheap. Show me the code." --underline 1
# 设置二项
highlight --str "Talk is cheap. Show me the code." --color 1 --bgcolor 6
highlight --str "Talk is cheap. Show me the code." --color 2 --bold 1
highlight --str "Talk is cheap. Show me the code." --color 2 --underline 1
highlight --str "Talk is cheap. Show me the code." --bgcolor 5 --bold 1
highlight --str "Talk is cheap. Show me the code." --bgcolor 5 --underline 1
highlight --str "Talk is cheap. Show me the code." --bold 1 --underline 1
# 设置三项
highlight --str "Talk is cheap. Show me the code." --color 1 --bgcolor 6 --bold 1
highlight --str "Talk is cheap. Show me the code." --color 1 --bgcolor 6 --underline 1
highlight --str "Talk is cheap. Show me the code." --color 2 --bold 1 --underline 1
highlight --str "Talk is cheap. Show me the code." --bgcolor 5 --bold 1 --underline 1
# 设置四项
highlight --str "Talk is cheap. Show me the code." --color 1 --bgcolor 6 --bold 1 --underline 1
# 高亮输出文本,不设置背景
highlight --str "Talk is cheap. Show me the code." --color 1 --bold 1
highlight --str "Talk is cheap. Show me the code." --color 2 --underline 1
highlight --str "Talk is cheap. Show me the code." --color 3 --bold 1
highlight --str "Talk is cheap. Show me the code." --color 4 --underline 1
highlight --str "Talk is cheap. Show me the code." --color 5 --bold 1
highlight --str "Talk is cheap. Show me the code." --color 6 --underline 1
highlight --str "Talk is cheap. Show me the code." --color 7 --bold 1
# 高亮输出文本,设置背景
highlight --str "Talk is cheap. Show me the code." --color 0 --bgcolor 7 --underline 1
highlight --str "Talk is cheap. Show me the code." --color 1 --bgcolor 6 --bold 1
highlight --str "Talk is cheap. Show me the code." --color 2 --bgcolor 5 --underline 1
highlight --str "Talk is cheap. Show me the code." --color 3 --bgcolor 4 --bold 1
highlight --str "Talk is cheap. Show me the code." --color 4 --bgcolor 3 --underline 1
highlight --str "Talk is cheap. Show me the code." --color 5 --bgcolor 2 --bold 1
highlight --str "Talk is cheap. Show me the code." --color 6 --bgcolor 1 --underline 1
highlight --str "Talk is cheap. Show me the code." --color 7 --bgcolor 0 --bold 1
exit 0