An open API service indexing awesome lists of open source software.

https://github.com/whtsky/parguments

A simple cli args parser for Python
https://github.com/whtsky/parguments

Last synced: 2 months ago
JSON representation

A simple cli args parser for Python

Awesome Lists containing this project

README

          

#parguments

A simple cli args parser for Python.

Useful for creating command-line scripts.

[![Build Status](https://travis-ci.org/whtsky/parguments.png?branch=master)](https://travis-ci.org/whtsky/parguments)
[![Coverage Status](https://coveralls.io/repos/whtsky/parguments/badge.png)](https://coveralls.io/r/whtsky/parguments)

##Example

```python
"""
catsup v1.0

Usage:
catsup init []
catsup build
catsup deploy
catsup -h | --help
catsup --version

Options:
-h --help show this screen.
-s --settings= specify a config file. [default: config.json]
"""
from parguments import Parguments

parguments = Parguments(__doc__, version='1.0')

@parguments.command
def init(path):
"""
Usage:
catsup init []

Options:
-h --help show this screen.
-s --settings= specify a setting file. [default: config.json]
"""
pass

@parguments.command
def build(settings):
"""
Usage:
catsup build [-s |--settings=]

Options:
-h --help show this screen.
-s --settings= specify a setting file. [default: config.json]
"""
pass

@parguments.command
def deploy(settings):
"""
Usage:
catsup deploy [-s |--settings=]

Options:
-h --help show this screen.
-s --settings= specify a setting file. [default: config.json]
"""
pass

if __name__ == '__main__':
parguments.run()

```

##Development

```bash
chmod +x dev.sh
./dev.sh
source bin/active
```