快速构建健壮的命令行界面。
nutcli的Python项目详细描述
nutcli—简而言之就是cli
Pythonnutcli
包允许您轻松创建健壮的基于命令的
命令行界面,可以将
python
和shell
。在
它还提供了几个有用的类和装饰器,可以帮助您改进 通过生成格式良好的输出和允许干运行的用户体验 有副作用的手术。在
链接
- 项目源代码:https://github.com/pbrezina/python-nutcli
- 项目文档:https://nutcli.readthedocs.io
- 在PyPi的项目:https://pypi.org/project/nutcli
安装
pip3 install nutcli
以身作则而不是千言万语
下面是一个非常基本的示例,可以了解这个包的作用和 如何使用它。在
^{pr2}$$ python3 ./main.py hello --hello world [my-cli] world$ python3 ./main.py --help usage: main.py [-h] [--log-execution] [--dry-run] [--no-colors] COMMANDS ...optional arguments:-h, --help show this help message and exit--log-execution Log execution of operations that supports it.--dry-run Do not execute operations with side effects. Only log what would be done.--no-colors Do not execute operations with side effects. Only log what would be done.Example Commands:COMMANDS hello Print hello message
- 项目
标签: