docopt-cmd-0.0.1
توضیحات
Pythonic commands and subcommands for docopt
| ویژگی | مقدار |
|---|---|
| سیستم عامل | - |
| نام فایل | docopt-cmd-0.0.1 |
| نام | docopt-cmd |
| نسخه کتابخانه | 0.0.1 |
| نگهدارنده | [] |
| ایمیل نگهدارنده | [] |
| نویسنده | Keerthan Jaic |
| ایمیل نویسنده | jckeerthan@gmail.com |
| آدرس صفحه اصلی | http://docopt.org |
| آدرس اینترنتی | https://pypi.org/project/docopt-cmd/ |
| مجوز | MIT |
==========================================
Simple commands and subcommands for docopt
==========================================
...
Example
-------
.. code-block:: python
"""Do somethings
Usage:
example.py [-vfr] do (a|b)
Options:
-v --verbose Be verbose.
-f --force Force.
-r --random Huh?.
"""
from docopt import docopt
from docopt_cmd import cmd
def main():
args = docopt(__doc__)
#print(args)
cmd.dispatch(args)
#explicitly specify spec and options to pass as arguments
@cmd('do a', force='--force')
def something(force):
print('doing a')
print(force)
#or use magic
@cmd
def do_b(random):
print 'doing b'
print random
if __name__ == '__main__':
main()
نحوه نصب
نصب پکیج whl docopt-cmd-0.0.1:
pip install docopt-cmd-0.0.1.whl
نصب پکیج tar.gz docopt-cmd-0.0.1:
pip install docopt-cmd-0.0.1.tar.gz