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.1.tar.gz
(2.8 kB
view details)
File details
Details for the file docopt-dispatch-0.0.1.tar.gz
.
File metadata
- Download URL: docopt-dispatch-0.0.1.tar.gz
- Upload date:
- Size: 2.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9eb3ea81072885a5ce6f9e997fbc06161d60ab6b783dd4487bf80ef8fda5c737 |
|
MD5 | d74b0d14787f35a9b81779ac8d7e3425 |
|
BLAKE2b-256 | 0389f05204befd4ec3cfbc8454b2d59c7eab2d618e47ad57b67ce5826543410f |