建造指挥组CLIs的装饰工
cli-builder的Python项目详细描述
clibuilder:用于构建命令组cli的装饰器
clibuilder提供了一个用户友好的界面来快速构建命令组cli。在
import cli_builder
dispatch = cli_builder.Dispatch()
my_cool_group = dispatch.group("my_cool_group")
my_other_cool_group = dispatch.group("my_other_cool_group")
@my_cool_group.command("do-stuff", arguments={
"positional": dict(type=str),
"--named": dict(type=int, default=5)
})
def my_func(args):
print(args.positional, args.named)
@my_cool_group.command("do-other-stuff", arguments=dict())
def my_other_func(args):
pass
@my_other_cool_group.command("do-stuff-in-other-group")
def other_group_command(args):
pass
安装
^{pr2}$链接
Bugs
请报告GitHub上的错误、问题、功能请求等。在
- 项目
标签: