You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/tutorial/options-autocompletion.md
+10Lines changed: 10 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -384,3 +384,13 @@ You can declare function parameters of these types:
384
384
*`List[str]`: for the raw *CLI parameters*.
385
385
386
386
It doesn't matter how you name them, in which order, or which ones of the 3 options you declare. It will all "**just work**" ✨
387
+
388
+
## Comparison to Click functionality
389
+
390
+
Note that Click 7 had a similar [`autocompletion` function](https://click.palletsprojects.com/en/7.x/bashcomplete/), but it worked slightly differently.
391
+
392
+
It required the callback function to take exactly the 3 arguments `ctx`, `args` and `incomplete` in that exact order, instead of matching them dynamically based on types, as Typer does.
393
+
394
+
Since Click 8, this functionality has been replaced by [`shell_complete`](https://click.palletsprojects.com/en/8.1.x/api/#click.ParamType.shell_complete), which still depends on the exact order of arguments for the callback function.
395
+
396
+
However, Typer continues to use the `autocompletion` functionality as described on this page.
Copy file name to clipboardExpand all lines: pyproject.toml
-2Lines changed: 0 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -115,8 +115,6 @@ xfail_strict = true
115
115
junit_family = "xunit2"
116
116
filterwarnings = [
117
117
"error",
118
-
# TODO: until I refactor completion to use the new shell_complete
119
-
"ignore:'autocompletion' is renamed to 'shell_complete'. The old name is deprecated and will be removed in Click 8.1. See the docs about 'Parameter' for information about new behavior.:DeprecationWarning:typer",
0 commit comments