Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

馃悰 Fix shell_complete not working for Arguments #737

Open
wants to merge 12 commits into
base: master
Choose a base branch
from

Conversation

bckohan
Copy link

@bckohan bckohan commented Jan 25, 2024

As pointed out in #334 the shell_complete parameter on Arguments is not called. This is a very simple bug where shell_complete was simply omitted as a parameter passed to TyperArgument.

This PR adds the missing parameter resulting in a one line change in the library and it adds one additional completion test that tests that shell_complete works as expected when given to an Argument.

Copy link

@dbosk dbosk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we need get_param_completion to be able to skip some of the parameters for the shell_complete function, such as shell_complete(incomplete: str).

typer/main.py Show resolved Hide resolved
tests/assets/compat_arg_complete_click7_8.py Outdated Show resolved Hide resolved
@svlandeg svlandeg added bug Something isn't working p2 labels Feb 28, 2024
@svlandeg svlandeg linked an issue Apr 19, 2024 that may be closed by this pull request
7 tasks
Copy link
Collaborator

@svlandeg svlandeg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice catch! The one line fix seems correct to me, and I can confirm that it fixes the bug that was reported earlier in #334.

Thanks for adding a test! I just moved it out of compat and into test_others.py where there were a few other completion tests as well. Not sure if this is where Tiangolo wants it or someplace else 馃槆

@svlandeg svlandeg changed the title Fix shell_complete not working for Arguments 馃悰 Fix shell_complete not working for Arguments Apr 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working p2
Projects
None yet
Development

Successfully merging this pull request may close these issues.

typer.Argument with autocompletion
3 participants