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
- Host: GitHub
- URL: https://github.com/whtsky/parguments
- Owner: whtsky
- License: mit
- Archived: true
- Created: 2013-01-27T09:53:53.000Z (about 13 years ago)
- Default Branch: master
- Last Pushed: 2019-04-07T20:59:43.000Z (almost 7 years ago)
- Last Synced: 2025-08-28T20:48:17.952Z (7 months ago)
- Language: Python
- Homepage: parguments.readthedocs.org
- Size: 34.2 KB
- Stars: 10
- Watchers: 3
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
#parguments
A simple cli args parser for Python.
Useful for creating command-line scripts.
[](https://travis-ci.org/whtsky/parguments)
[](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
```