Metadata-Version: 2.1
Name: owcli
Version: 0.6.0
Summary: CLI framework which supports both command and subcommand.
Home-page: https://github.com/tadashi-aikawa/owcli.git
Author: tadashi-aikawa
Author-email: syou.maman@gmail.com
Maintainer: tadashi-aikawa
Maintainer-email: syou.maman@gmail.com
License: MIT
Keywords: cli framework
Platform: UNKNOWN
Classifier: Development Status :: 2 - Pre-Alpha
Classifier: Intended Audience :: Developers
Classifier: Topic :: Software Development :: Libraries :: Application Frameworks
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: 3.7
Description-Content-Type: text/markdown
Requires-Dist: docopt
Requires-Dist: owlmixin
Provides-Extra: test
Requires-Dist: twine ; extra == 'test'
Requires-Dist: wheel ; extra == 'test'
Requires-Dist: pipenv ; extra == 'test'
Requires-Dist: urllib3 (>=1.24.2) ; extra == 'test'
Requires-Dist: pylint ; extra == 'test'
Requires-Dist: rope ; extra == 'test'
Requires-Dist: black ; extra == 'test'

owcli
=====

[![versions](https://img.shields.io/pypi/pyversions/owcli.svg)]()
[![pypi](https://img.shields.io/pypi/v/owcli.svg)]()
[![license](https://img.shields.io/github/license/mashape/apistatus.svg)]()

CLI framework which supports both command and subcommand based on [docopt].

[docopt]: http://docopt.org/


Install
-------

```
$ pip install owcli
```


Quick start
-----------

Create owcli project.

```
$ owcli init <app_name>
```

Run

```
$ cd <app_name>
$ pipenv install
$ pipenv run python <app_name>/main.py --help
```

### Concrete example

```bash
$ 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
```


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.



