CLI framework which supports both command and subcommand.
Project description
owcli
CLI framework which supports both command and subcommand.
Install
$ pip install owcli
Quick start
Create owcli project.
$ owcli init <app_name>
Run
$ cd <app_name>
$ <app_name>/main.py --help
Concrete example
$ owcli init testapp
------------------------
| Create entries... |
------------------------
๐ C:\Users\syoum\git\github.com\tadashi-aikawa\owcli\yuya
โ๐ Pipfile
โ๐ yuya
โ๐ 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
$ testapp/main.py --help
Usage:
testapp <command> [<subcommand>] [<args>...]
testapp <command> [<subcommand>] (-h | --help)
testapp (-h | --help)
testapp --version
Commands:
cmd1 Command1
cmd2 Command2
$ testapp/main.py cmd2
Usage:
testapp cmd2 [<subcommand>] [<args>...]
testapp cmd2 (-h | --help)
Subcommands:
subcmd1 Subcommand1
subcmd2 Subcommand2
$ 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.
$ testapp/main.py cmd2 subcmd1 hoge hoga hogu -f
flag: true
names:
- hoge
- hoga
- hogu
For developer
Requirements
- pipenv
- make
- bats
Commands
Create and activate env
$ make init
$ pipenv shell
Integration test
$ make test-cli
Version up
Confirm that your branch name equals release version
$ make release
Finally, create pull request and merge to master!!
Licence
MIT
This software is released under the MIT License, see LICENSE.txt.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
No source distribution files available for this release.See tutorial on generating distribution archives.
Built Distribution
owcli-0.1.3-py3-none-any.whl
(9.5 kB
view hashes)