Cmdopt-0.2.0
توضیحات
pretty good command-line option parser
| ویژگی | مقدار |
|---|---|
| سیستم عامل | OS Independent |
| نام فایل | Cmdopt-0.2.0 |
| نام | Cmdopt |
| نسخه کتابخانه | 0.2.0 |
| نگهدارنده | [] |
| ایمیل نگهدارنده | [] |
| نویسنده | Makoto Kuwata |
| ایمیل نویسنده | kwa@kuwata-lab.com |
| آدرس صفحه اصلی | http://pypi.python.org/pypi/Cmdopt |
| آدرس اینترنتی | https://pypi.org/project/Cmdopt/ |
| مجوز | MIT License |
Overview
========
Cmdopt.py is command-line option parser for Python.
Example::
import sys, cmdopt
## create parser
parser = cmdopt.Parser()
## define options
parser.option("-h, --help", "show help")
parser.option("-f, --file=FILE", "read file")
parser.option("-i, --indent=N", "indent width")\
.validation(lambda val: not val.isdigit() and "integer required.")\
.action(lambda val, opts: setattr(opts, 'indent', int(val)))
## parse args
args = sys.argv[1:]
opts = parser.parse(args) # may raise cmdopt.ParseError
if opts.help:
print(parser.help()) # or parser.help(width=15, indent=" ")
Features:
* Validator
* Handler
* Help message
* Multiple option
See README_ for details.
.. _README: https://bitbucket.org/kwatch/cmdopt/wiki/Cmdopt.py
نحوه نصب
نصب پکیج whl Cmdopt-0.2.0:
pip install Cmdopt-0.2.0.whl
نصب پکیج tar.gz Cmdopt-0.2.0:
pip install Cmdopt-0.2.0.tar.gz