Skip to content

Commit

Permalink
completion doesn't fail with expose_value=False (#2556)
Browse files Browse the repository at this point in the history
  • Loading branch information
davidism authored Jul 6, 2023
2 parents 5499471 + 4cf7c6c commit b67fe5f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
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

0 comments on commit b67fe5f

Please sign in to comment.