单击plugin以显示cli的命令树
click-command-tree的Python项目详细描述
单击命令树
警告:这实际上只通过python3和单击6和7进行了测试。我计划做更好的测试和集成ci,所以找到所有 可与之一起使用的可能版本
click-command-tree
是一个显示cli命令树的click插件
安装
pip install click-command-tree
示例:
frompkg_resourcesimportiter_entry_pointsimportclickfromclick_pluginsimportwith_plugins@with_plugins(iter_entry_points('click_command_tree'))@click.group()defroot():pass@root.group()defcommand_group():pass@command_group.command()defnested_command():pass@root.command()defstandard_command():passif__name__=='__main__':root()
↪ python example.py --help
Usage: example.py [OPTIONS] COMMAND [ARGS]...
Options:
--help Show this message and exit.
Commands:
command-group
standard-command
tree
↪ python example.py tree
root
├── command-group
│ └── nested-command
├── standard-command
└── tree