支持命令和子命令的cli框架。
owcli的Python项目详细描述
owcli
cli框架,支持基于docopt的命令和子命令。
安装
$ pip install owcli
快速启动
创建owcli项目。
$ owcli init <app_name>
运行
$ cd <app_name>
$ pipenv install
$ pipenv run python <app_name>/main.py --help
具体例子
$ owcli init testapp ------------------------ | Create entries... | ------------------------ ? /mnt/c/Users/syoum/git/github.com/tadashi-aikawa/owcli/testapp ∟? Pipfile ∟? README.md ∟? setup.py ∟? testapp ∟? commands ∟? cmd1 ∟? main.py ∟? __init__.py ∟? cmd2 ∟? main.py ∟? subcmd1 ∟? main.py ∟? __init__.py ∟? subcmd2 ∟? main.py ∟? __init__.py ∟? __init__.py ∟? __init__.py ∟? main.py ∟? __init__.py ------------------------ | Next you have to ... | ------------------------ . . $ cd testapp $ pipenv install $ pipenv shell $ python testapp/main.py --help Usage: testapp <command> [<subcommand>][<args>...] testapp <command> [<subcommand>](-h | --help) testapp (-h | --help) testapp --version Commands: cmd1 Command1 cmd2 Command2 $ python testapp/main.py cmd2 -h Usage: testapp cmd2 [<subcommand>][<args>...] testapp cmd2 (-h | --help) Subcommands: subcmd1 Subcommand1 subcmd2 Subcommand2 $ python testapp/main.py cmd2 subcmd1 --help Subcommand1 Usage: testapp cmd2 subcmd1 <names>... [-f|--flag] testapp cmd2 subcmd1 (-h | --help) Options: <names>... Names -f --flag Flag -h --help Show this screen. $ python testapp/main.py cmd2 subcmd1 hoge hoga hogu -f flag: true names: - hoge - hoga - hogu
对于开发者
要求
- pipenv
- 制造
- 蝙蝠
命令
创建并激活env
$ make init
$ pipenv shell
集成测试
$ make test-cli
版本升级
确认您的分行名称等于发行版本
$ make release
$ make init
$ pipenv shell
$ make test-cli
版本升级
确认您的分行名称等于发行版本
$ make release
最后,创建pull请求并合并到master!!
许可证
麻省理工学院
此软件是在麻省理工学院的许可下发布的,请参阅license.txt。