Skip to content

Commit b764667

Browse files
authored
doc: add figlet.md (#576)
* add figlet.md * append description for install
1 parent f707edb commit b764667

File tree

1 file changed

+160
-0
lines changed

1 file changed

+160
-0
lines changed

command/figlet.md

Lines changed: 160 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,160 @@
1+
figlet
2+
===
3+
4+
字符串转为 “字画符”。
5+
6+
## 安装
7+
8+
+ Ubuntu 等系统
9+
10+
```shell
11+
apt-get update
12+
apt-get install -y figlet
13+
```
14+
15+
+ CentOS 等系统
16+
17+
```shell
18+
yum install epel-release
19+
yum install -y figlet
20+
```
21+
22+
## 概要
23+
24+
```shell
25+
figlet [ message ] [ -option ]
26+
```
27+
28+
## 主要用途
29+
30+
- 将普通字符串转为有简单字符拼接而成的 “字画符”。
31+
32+
## 参数
33+
34+
message 是需要转换的字符串。
35+
当没有输入 message 时,会读取标准输入,因此可以配合管道符等使用。
36+
37+
## 选项
38+
39+
```shell
40+
-w 限制输出宽度,默认为 '80'
41+
-c 居中显示
42+
-f 指定字体,默认为 'standard'
43+
-k 保留字符之间的空隙
44+
-t 对齐宽度到当前终端的宽度,这个参数优先级比 -w 高
45+
-v 显示版本信息
46+
```
47+
48+
## 返回值
49+
50+
字符串,由简单字符拼接而成的 “字画符”。
51+
52+
## 示例
53+
54+
- 从参数输入
55+
56+
```shell
57+
figlet 'Hello, World!'
58+
```
59+
60+
<pre style="line-height:1.2;">
61+
_ _ _ _ __ __ _ _ _
62+
| | | | ___| | | ___ \ \ / /__ _ __| | __| | |
63+
| |_| |/ _ \ | |/ _ \ \ \ /\ / / _ \| '__| |/ _` | |
64+
| _ | __/ | | (_) | \ V V / (_) | | | | (_| |_|
65+
|_| |_|\___|_|_|\___( ) \_/\_/ \___/|_| |_|\__,_(_)
66+
</pre>
67+
68+
- 配合管道符输入
69+
70+
```shell
71+
echo 'Hello, World!' | figlet
72+
```
73+
74+
<pre style="line-height:1.2;">
75+
_ _ _ _ __ __ _ _ _
76+
| | | | ___| | | ___ \ \ / /__ _ __| | __| | |
77+
| |_| |/ _ \ | |/ _ \ \ \ /\ / / _ \| '__| |/ _` | |
78+
| _ | __/ | | (_) | \ V V / (_) | | | | (_| |_|
79+
|_| |_|\___|_|_|\___( ) \_/\_/ \___/|_| |_|\__,_(_)
80+
</pre>
81+
82+
- 限制宽度
83+
84+
```shell
85+
figlet 'Hello, World!' -w 40
86+
```
87+
88+
<pre style="line-height:1.2;">
89+
_ _ _ _
90+
| | | | ___| | | ___
91+
| |_| |/ _ \ | |/ _ \
92+
| _ | __/ | | (_) |
93+
|_| |_|\___|_|_|\___( )
94+
|/
95+
__ __ _ _ _
96+
\ \ / /__ _ __| | __| | |
97+
\ \ /\ / / _ \| '__| |/ _` | |
98+
\ V V / (_) | | | | (_| |_|
99+
\_/\_/ \___/|_| |_|\__,_(_)
100+
</pre>
101+
102+
- 居中显示
103+
104+
```shell
105+
figlet 'Hello, World!' -w 40 -c
106+
```
107+
108+
<pre style="line-height:1.2;">
109+
_ _ _ _
110+
| | | | ___| | | ___
111+
| |_| |/ _ \ | |/ _ \
112+
| _ | __/ | | (_) |
113+
|_| |_|\___|_|_|\___( )
114+
|/
115+
__ __ _ _ _
116+
\ \ / /__ _ __| | __| | |
117+
\ \ /\ / / _ \| '__| |/ _` | |
118+
\ V V / (_) | | | | (_| |_|
119+
\_/\_/ \___/|_| |_|\__,_(_)
120+
</pre>
121+
122+
- 指定字体
123+
124+
```shell
125+
figlet 'Hello, World!' -w 40 -c -f slant
126+
```
127+
128+
<pre style="line-height:1.2;">
129+
__ __ ____
130+
/ / / /__ / / /___
131+
/ /_/ / _ \/ / / __ \
132+
/ __ / __/ / / /_/ /
133+
/_/ /_/\___/_/_/\____( )
134+
|/
135+
_ __ __ ____
136+
| | / /___ _____/ /___/ / /
137+
| | /| / / __ \/ ___/ / __ / /
138+
| |/ |/ / /_/ / / / / /_/ /_/
139+
|__/|__/\____/_/ /_/\__,_(_)
140+
</pre>
141+
142+
- 保留字符之间的空隙
143+
144+
```shell
145+
figlet 'Hello, World!' -w 40 -c -k
146+
```
147+
148+
<pre style="line-height:1.2;">
149+
_ _ _ _
150+
| | | | ___ | || | ___
151+
| |_| | / _ \| || | / _ \
152+
| _ || __/| || || (_) |_
153+
|_| |_| \___||_||_| \___/( )
154+
|/
155+
__ __ _ _ _
156+
\ \ / /___ _ __ | | __| || |
157+
\ \ /\ / // _ \ | '__|| | / _` || |
158+
\ V V /| (_) || | | || (_| ||_|
159+
\_/\_/ \___/ |_| |_| \__,_|(_)
160+
</pre>

0 commit comments

Comments
 (0)