Skip to content
Myr

index.rst

This file

Path

docs/index.rst

107 lines · 2.2 KiB

Last changed by

Merge pull request #1792 from pallets/consistencyDavid Lordbefore adoption98e471f

History of this file

Take it

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

Merge pull request #1575 from pallets/dependabot/pip/tox-3.15.2dependabot-preview[bot]before adoption7b9a72f

lines 1–81why, one step back
1.. rst-class:: hide-header
23Welcome to Click4================56.. image:: _static/click-logo.png7 :align: center8 :scale: 50%9 :target: https://palletsprojects.com/p/click/1011Click is a Python package for creating beautiful command line interfaces12in a composable way with as little code as necessary. It's the "Command13Line Interface Creation Kit". It's highly configurable but comes with14sensible defaults out of the box.1516It aims to make the process of writing command line tools quick and fun17while also preventing any frustration caused by the inability to implement18an intended CLI API.1920Click in three points:2122- arbitrary nesting of commands23- automatic help page generation24- supports lazy loading of subcommands at runtime2526What does it look like? Here is an example of a simple Click program:2728.. click:example::2930 import click3132 @click.command()33 @click.option('--count', default=1, help='Number of greetings.')34 @click.option('--name', prompt='Your name',35 help='The person to greet.')36 def hello(count, name):37 """Simple program that greets NAME for a total of COUNT times."""38 for x in range(count):39 click.echo(f"Hello {name}!")4041 if __name__ == '__main__':42 hello()4344And what it looks like when run:4546.. click:run::4748 invoke(hello, ['--count=3'], prog_name='python hello.py', input='John\n')4950It automatically generates nicely formatted help pages:5152.. click:run::5354 invoke(hello, ['--help'], prog_name='python hello.py')5556You can get the library directly from PyPI::5758 pip install click5960Documentation61-------------6263This part of the documentation guides you through all of the library's64usage patterns.6566.. toctree::67 :maxdepth: 26869 why70 quickstart71 setuptools72 parameters73 options74 arguments75 commands76 prompts77 documentation78 complex79 advanced80 testing81 utils

Merge pull request #1622 from MLH-Fellowship/1484-redesign-completionDavid Lordbefore adoption6c8301e

line 82why, one step back
82 shell-completion

Merge pull request #1575 from pallets/dependabot/pip/tox-3.15.2dependabot-preview[bot]before adoption7b9a72f

lines 83–106why, one step back
83 exceptions
84 unicode-support85 wincmd8687API Reference88-------------8990If you are looking for information on a specific function, class, or91method, this part of the documentation is for you.9293.. toctree::94 :maxdepth: 29596 api9798Miscellaneous Pages99-------------------100101.. toctree::102 :maxdepth: 2103104 contrib105 upgrading106 license

Merge pull request #1792 from pallets/consistencyDavid Lordbefore adoption98e471f

line 107why, one step back
107 changes