Skip to content
Myr

✏️ Fix small typos in the tutorial documentation (#1137)

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Sofie Van Landeghem · committed by GitHub · parent d3d3e46 · Browse files · 2 files+3 added−3 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

2 files+3 added−3 removed

  • other:+3 added−3 removed

2 files+3 added−3 removed

modified:docs/tutorial/options/callback-and-context.md+1 added-1 removed
41 unmodified lines
42There's something to be aware of with callbacks and completion that requires some small special handling.4344But first let's just use completion in your shell (Bash, Zsh, Fish, or PowerShell).4546After installing completion (for your own Python package), when you use your CLI program and start adding a *CLI option* with `--` an then hit <kbd>TAB</kbd>, your shell will show you the available *CLI options* (the same for *CLI arguments*, etc).46After installing completion (for your own Python package), when you use your CLI program and start adding a *CLI option* with `--` and then hit <kbd>TAB</kbd>, your shell will show you the available *CLI options* (the same for *CLI arguments*, etc).4748To check it quickly with the previous script use the `typer` command:4950<div class="termy">
161 unmodified lines
modified:docs/tutorial/options-autocompletion.md+2 added-2 removed
8 unmodified lines
9## Review completion1011Before checking how to provide custom completions, let's check again how it works.1213After installing completion for your own Python package (or using the `typer` command), when you use your CLI program and start adding a *CLI option* with `--` an then hit <kbd>TAB</kbd>, your shell will show you the available *CLI options* (the same for *CLI arguments*, etc).13After installing completion for your own Python package (or using the `typer` command), when you use your CLI program and start adding a *CLI option* with `--` and then hit <kbd>TAB</kbd>, your shell will show you the available *CLI options* (the same for *CLI arguments*, etc).1415To check it quickly without creating a new Python package, use the `typer` command.1617Then let's create a small example program:
146 unmodified lines
164That simplifies our code a bit and works the same.165166/// tip167168If all the `yield` part seems complex for you, don't worry, you can just use the version with the `list` above.168If the `yield` part seems complex for you, don't worry, you can just use the version with the `list` above.169170In the end, that's just to save us a couple of lines of code.171172///
224 unmodified lines