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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

completion doesn't fail with expose_value=False #2556

Merged
merged 1 commit into from
Jul 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ Unreleased
- Remove outdated and unnecessary detection of App Engine environment. :pr:`2554`
- ``echo()`` does not fail when no streams are attached, such as with ``pythonw`` on
Windows. :issue:`2415`
- Argument with ``expose_value=False`` do not cause completion to fail. :issue:`2336`


Version 8.1.3
Expand Down
3 changes: 2 additions & 1 deletion src/click/shell_completion.py
Original file line number Diff line number Diff line change
Expand Up @@ -443,7 +443,8 @@ def _is_incomplete_argument(ctx: Context, param: Parameter) -> bool:
return False

assert param.name is not None
value = ctx.params[param.name]
# Will be None if expose_value is False.
value = ctx.params.get(param.name)
return (
param.nargs == -1
or ctx.get_parameter_source(param.name) is not ParameterSource.COMMANDLINE
Expand Down