Merge pull request #990 from dougharris/click-readme
Before adoption: this commit came in with the history the project adopted, so no landing records it.
Updating README to match flask style.
authored by David Lord · committed by GitHub · parents 3f66498, 4ebaff2 · Browse files · 3 files·+100 added−68 removed
This commit
State
Before adoption: this commit came in with the history the project adopted, so no landing records it.
Diff stats
3 files+100 added−68 removed
- other:+100 added−68 removed
Provenance
- Commit
df1a8f5- Tree
21d7b36- Author
David Lord <davidism@gmail.com>- Committer
GitHub <noreply@github.com>- Parent 1
3f66498- Parent 2
4ebaff2
3 files changed+100 added−68 removed
deleted:README.md-64 removed
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364# $ click_
[](https://ci.appveyor.com/project/tygerbytes/resourcefitness)
## What's Click?
Click is a Python package for creating beautiful command line interfacesin a composable way with as little code as necessary. It's the "CommandLine Interface Creation Kit". It's highly configurable but comes withsensible defaults out of the box.
It aims to make the process of writing command line tools quick and funwhile also preventing any frustration caused by the inability to implementan intended CLI API.
Click in three points: - arbitrary nesting of commands - automatic help page generation - supports lazy loading of subcommands at runtime ## Example What does it look like? Here is an example of a simple Click program:```pythonimport click
@click.command()@click.option('--count', default=1, help='Number of greetings.')@click.option('--name', prompt='Your name', help='The person to greet.')def hello(count, name): """Simple program that greets NAME for a total of COUNT times.""" for x in range(count): click.echo('Hello %s!' % name)
if __name__ == '__main__': hello()```And what it looks like when run:```shell$ python hello.py --count=3Your name: JohnHello John!Hello John!Hello John!```
## InstallationThe installation process is easy and contained.```$ pip install Click```Or you can build from source.```$ git clone https://github.com/pallets/click.git$ python setup.py install ``` ## Documentation
Read the docs at http://click.pocoo.org/
## Status
This library is stable and active. Feedback is always welcome!added:README.rst+92 added
1+\$ click\_2+==========3+4+What's Click?5+-------------6+7+Click is a Python package for creating beautiful command line interfaces8+in a composable way with as little code as necessary. It's the "Command9+Line Interface Creation Kit". It's highly configurable but comes with10+sensible defaults out of the box.11+12+It aims to make the process of writing command line tools quick and fun13+while also preventing any frustration caused by the inability to implement14+an intended CLI API.15+16+Click in three points:17+ - arbitrary nesting of commands18+ - automatic help page generation19+ - supports lazy loading of subcommands at runtime20+21+22+Installing23+----------24+25+Install and update using `pip`_:26+27+.. code-block:: text28+29+ $ pip install click30+31+A Simple Example32+----------------33+34+What does it look like? Here is an example of a simple Click program:35+36+.. code-block:: python37+38+ import click39+ 40+ @click.command()41+ @click.option('--count', default=1, help='Number of greetings.')42+ @click.option('--name', prompt='Your name',43+ help='The person to greet.')44+ def hello(count, name):45+ """Simple program that greets NAME for a total of COUNT times."""46+ for x in range(count):47+ click.echo('Hello %s!' % name)48+ 49+ if __name__ == '__main__':50+ hello()51+52+And what it looks like when run:53+54+.. code-block:: text55+56+ $ python hello.py --count=357+ Your name: John58+ Hello John!59+ Hello John!60+ Hello John!61+62+Donate63+------64+65+The Pallets organization develops and supports Flask and the libraries66+it uses. In order to grow the community of contributors and users, and67+allow the maintainers to devote more time to the projects, `please68+donate today`_.69+70+.. _please donate today: https://psfmember.org/civicrm/contribute/transact?reset=1&id=2071+72+73+Links74+-----75+76+* Website: https://www.palletsprojects.com/p/click/77+* Documentation: http://click.pocoo.org/78+* License: `BSD <https://github.com/pallets/click/blob/master/LICENSE>`_79+* Releases: https://pypi.org/project/click/80+* Code: https://github.com/pallets/click81+* Issue tracker: https://github.com/pallets/click/issues82+* Test status:83+84+ * Linux, Mac: https://travis-ci.org/pallets/click85+ * Windows: https://ci.appveyor.com/project/pallets/click86+87+* Test coverage: https://codecov.io/gh/pallets/click88+89+.. _WSGI: https://wsgi.readthedocs.io90+.. _Werkzeug: https://www.palletsprojects.com/p/werkzeug/91+.. _Jinja: https://www.palletsprojects.com/p/jinja/92+.. _pip: https://pip.pypa.io/en/stable/quickstart/modified:setup.py+8 added-4 removed
1+#!/usr/bin/env python2+# -*- coding: utf-8 -*-3+import io4 import re2-import ast5 from setuptools import setup6 7 8 _version_re = re.compile(r'__version__\s+=\s+(.*)')9 10 9-with open('click/__init__.py', 'rb') as f:10- version = str(ast.literal_eval(_version_re.search(11- f.read().decode('utf-8')).group(1)))11+with io.open('README.rst', 'rt', encoding='utf8') as f:12+ readme = f.read()13 14+with io.open('click/__init__.py', 'rt', encoding='utf8') as f:15+ version = re.search(r'__version__ = \'(.*?)\'', f.read()).group(1)16 17 setup(18 name='click',19 version=version,1 unmodified line21 author='Armin Ronacher',22 author_email='armin.ronacher@active-4.com',23 maintainer='Pallets team',24 maintainer_email='contact@palletsprojects.com',25+ long_description=readme,26 packages=['click'],27 description='A simple wrapper around optparse for '28 'powerful command line utilities.',29 license='BSD',15 unmodified lines