Skip to content

Commit cfbeb3d

Browse files
committed
add note in the documentation about comparison to Click functionality
1 parent 1975fce commit cfbeb3d

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

docs/tutorial/options-autocompletion.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -564,3 +564,13 @@ You can declare function parameters of these types:
564564
* `List[str]`: for the raw *CLI parameters*.
565565

566566
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**" ✨
567+
568+
## Comparison to Click functionality
569+
570+
Note that Click 7 had a similar [`autocompletion` function](https://click.palletsprojects.com/en/7.x/bashcomplete/), but it worked slightly differently.
571+
572+
It required the callback function to take exactly the 3 keyword arguments `ctx`, `args` and `incomplete` in that exact order, instead of matching them dynamically based on types, as Typer does.
573+
574+
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.
575+
576+
However, Typer continues to use the `autocompletion` functionality as described on this page.

0 commit comments

Comments
 (0)