Skip to content
Myr

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 file

Take it

The walk stopped after 200 commits: lines older than e9ec187 point at it.

Corrected col distance checkArmin Ronacherbefore adoptione9ec187

lines 1–24why, one step back
1Welcome to the Click Documentation
2==================================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()

Updated the exampleArmin Ronacherbefore adoptiona5a0471

line 25why, one step back
25 @click.option('--count', default=1, help='Number of greetings.')

Corrected col distance checkArmin Ronacherbefore adoptione9ec187

line 26why, one step back
26 @click.option('--name', prompt='Your name',

Updated the exampleArmin Ronacherbefore adoptiona5a0471

line 27why, one step back
27 help='The person to greet.')

Corrected col distance checkArmin Ronacherbefore adoptione9ec187

line 28why, one step back
28 def hello(count, name):

Updated the exampleArmin Ronacherbefore adoptiona5a0471

line 29why, one step back
29 """Simple program that greets NAME for a total of COUNT times."""

Corrected col distance checkArmin Ronacherbefore adoptione9ec187

lines 30–34why, one step back
30 for x in range(count):
31 click.echo('Hello %s!' % name)3233 if __name__ == '__main__':34 hello()

Updated the exampleArmin Ronacherbefore adoptiona5a0471

lines 35–46why, one step back
35
36And 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'])

Corrected col distance checkArmin Ronacherbefore adoptione9ec187

lines 47–71why, one step back
47
48You 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 advanced

Added testing docsArmin Ronacherbefore adoption48f3e91

line 72why, one step back
72 testing

Updated docs for streamsArmin Ronacherbefore adoptionfff6b28

line 73why, one step back
73 utils

Added basic bash complete support.Armin Ronacherbefore adoption4fa40cf

line 74why, one step back
74 bashcomplete

Corrected col distance checkArmin Ronacherbefore adoptione9ec187

lines 75–86why, one step back
75 python3
7677API 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 api

Added license to docs and changelog.Armin Ronacherbefore adoptionddf58b2

lines 87–94why, one step back
87
88Other Documents89---------------9091.. toctree::92 :maxdepth: 29394 changelog

Updated docs for upgrade information.Armin Ronacherbefore adoptionebde9a0

line 95why, one step back
95 upgrading

Added license to docs and changelog.Armin Ronacherbefore adoptionddf58b2

line 96why, one step back
96 license