Dispatch from command-line arguments to functions
Project description
Experimental.
Example
"""Run something in development or production mode.
Usage: run-something.py (--development | --production) <host> <port>
"""
from docopt_dispatch import dispatch
@dispatch.on('--development'):
def development(host, port, **kwargs):
print('in *development* mode')
@dispatch.on('--production'):
def development(host, port, **kwargs):
print('in *production* mode')
if __name__ == '__main__':
dispatch(__doc__)
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 Distribution
docopt-dispatch-0.0.0.tar.gz
(2.7 kB
view details)
File details
Details for the file docopt-dispatch-0.0.0.tar.gz
.
File metadata
- Download URL: docopt-dispatch-0.0.0.tar.gz
- Upload date:
- Size: 2.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0cbe69826b868a9adb13458d37f2d0aca82ed7271ddaec9e9ed3b95ece14c92f |
|
MD5 | 27de9a3e5888ce99169f2a59d9fa4971 |
|
BLAKE2b-256 | 3cb78ad27b40f0d944bbdd527dbb1eb53e9a5a9f1357cc1dcc2f9394bc616302 |