支持:
- 命令的任意嵌套
- 自动生成帮助信息
- 支持在运行时子命令的延迟加载
安装方法是使用 pip:
下面一小段代码是其官方主页的例子,贴出来下:
运行:
查看帮助信息:
支持:
安装方法是使用 pip:
下面一小段代码是其官方主页的例子,贴出来下:
运行:
查看帮助信息:
$ python hello.py --help
Usage: hello.py [OPTIONS]
Simple program that greets NAME for a total of COUNT times.
Options:
--count INTEGER Number of greetings.
--name TEXT The person to greet.
--help Show this message and exit.
转自: https://segmentfault.com/a/1190000000766489
以下是我自己执行的代码和结果