index.rst
This file
Path
docs/index.rst
96 lines · 2.0 KiB
Last changed by
Added basic bash complete support.Armin Ronacherbefore adoption4fa40cf
History of this fileTake it
1Welcome to the Click Documentation2==================================34click is a Python package for creating beautiful command line interfaces5in a composable way with as little amount of code as necessary. It's the6"Command Line Interface Creation Kit". It's highly configurable but comes7with good defaults out of the box.89It aims at making writing command line tools fun and quick without causing10user frustration at not being able to implement an intended CLI API.1112Click in three points:1314- arbitrary nesting of commands15- automatic help page generation16- supports lazy loading of subcommands at runtime1718What does it look like? A simple example can be this:1920.. click:example::2122 import click2324 @click.command()25 @click.option('--count', default=1, help='Number of greetings.')26 @click.option('--name', prompt='Your name',27 help='The person to greet.')28 def hello(count, name):29 """Simple program that greets NAME for a total of COUNT times."""30 for x in range(count):31 click.echo('Hello %s!' % name)3233 if __name__ == '__main__':34 hello()3536And what it looks like:3738.. click:run::3940 invoke(hello, ['--count=3'], input='John\n')4142And it gives you nicely formatted help pages:4344.. click:run::4546 invoke(hello, ['--help'])4748You can get the library directly from PyPI::4950 pip install click5152Documentation Contents53----------------------5455This part of the documentation guides you through all the usage patterns56of the library.5758.. toctree::59 :maxdepth: 26061 why62 quickstart63 parameters64 options65 arguments66 commands67 prompts68 documentation69 setuptools70 complex71 advanced72 testing73 utils74 bashcomplete75 python37677API Reference78-------------7980If you are looking for information on a specific function, class or81method, this part of the documentation is for you.8283.. toctree::84 :maxdepth: 28586 api8788Other Documents89---------------9091.. toctree::92 :maxdepth: 29394 changelog95 upgrading96 license