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 hashes)