Skip to content

Commit 42882f4

Browse files
committed
docs(pypi-package): add utils/click
1 parent 095e74f commit 42882f4

File tree

3 files changed

+107
-61
lines changed

3 files changed

+107
-61
lines changed

docs/pypi-package/utils/click.md

+51
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
---
2+
title: click - 增强的命令行参数处理
3+
description: click - 增强的命令行参数处理
4+
---
5+
6+
# click - 增强的命令行参数处理
7+
8+
[[TOC]]
9+
10+
11+
## 1. 项目简介
12+
13+
| 项目 | 信息 |
14+
| ----------- | ------------------------------------------------------------------------------------- |
15+
| 项目地址 | [PyPI](https://pypi.org/project/click/) \| [GitHub](https://github.com/pallets/click) |
16+
| 官方文档 | [palletsprojects.com](https://palletsprojects.com/p/click/) |
17+
| 开源协议 | BSD 3 |
18+
| Python 版本 | >= Python 3.7 |
19+
| 标签 | 工具 |
20+
21+
Click 用于以可组合的方式用尽可能少的代码创建漂亮的命令行界面。它是命令行界面创建工具包。它是高度可配置的,并且开箱即用的合理默认值。
22+
23+
它的目的是使编写命令行工具的过程变得快速而有趣,同时也防止因无法实现预定的 CLI API 而引起的任何错误。
24+
25+
特点是:
26+
- 命令的任意嵌套
27+
- 自动生成帮助页
28+
- 支持在运行时偷懒加载子命令
29+
30+
安装:
31+
32+
```bash
33+
pip install -U click
34+
```
35+
36+
简单示例:
37+
38+
```python
39+
import click
40+
41+
@click.command()
42+
@click.option("--count", default=1, help="Number of greetings.")
43+
@click.option("--name", prompt="Your name", help="The person to greet.")
44+
def hello(count, name):
45+
"""Simple program that greets NAME for a total of COUNT times."""
46+
for _ in range(count):
47+
click.echo(f"Hello, {name}!")
48+
49+
if __name__ == '__main__':
50+
hello()
51+
```

package.json

+4-4
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@
2323
"@vuepress/client": "2.0.0-beta.61",
2424
"vue": "^3.2.47",
2525
"vuepress": "2.0.0-beta.61",
26-
"vuepress-plugin-auto-catalog": "2.0.0-beta.185",
27-
"vuepress-plugin-copy-code2": "2.0.0-beta.185",
28-
"vuepress-plugin-md-enhance": "2.0.0-beta.185",
29-
"vuepress-plugin-search-pro": "2.0.0-beta.185"
26+
"vuepress-plugin-auto-catalog": "2.0.0-beta.186",
27+
"vuepress-plugin-copy-code2": "2.0.0-beta.186",
28+
"vuepress-plugin-md-enhance": "2.0.0-beta.186",
29+
"vuepress-plugin-search-pro": "2.0.0-beta.186"
3030
}
3131
}

pnpm-lock.yaml

+52-57
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)