Skip to content
Merged
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
17 changes: 11 additions & 6 deletions src/click/shell_completion.py
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,11 @@ class ShellComplete:
be provided by subclasses.
"""

cli: Command
ctx_args: cabc.MutableMapping[str, t.Any]
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

We should perhaps improve this later, but out of scope for this PR.

prog_name: str
complete_var: str

def __init__(
self,
cli: Command,
Expand Down Expand Up @@ -305,8 +310,8 @@ def complete(self) -> str:
class BashComplete(ShellComplete):
"""Shell completion for Bash."""

name = "bash"
source_template = _SOURCE_BASH
name: t.ClassVar[str] = "bash"
source_template: t.ClassVar[str] = _SOURCE_BASH

@staticmethod
def _check_version() -> None:
Expand Down Expand Up @@ -364,8 +369,8 @@ def format_completion(self, item: CompletionItem) -> str:
class ZshComplete(ShellComplete):
"""Shell completion for Zsh."""

name = "zsh"
source_template = _SOURCE_ZSH
name: t.ClassVar[str] = "zsh"
source_template: t.ClassVar[str] = _SOURCE_ZSH

def get_completion_args(self) -> tuple[list[str], str]:
cwords = split_arg_string(os.environ["COMP_WORDS"])
Expand Down Expand Up @@ -400,8 +405,8 @@ def format_completion(self, item: CompletionItem) -> str:
class FishComplete(ShellComplete):
"""Shell completion for Fish."""

name = "fish"
source_template = _SOURCE_FISH
name: t.ClassVar[str] = "fish"
source_template: t.ClassVar[str] = _SOURCE_FISH

def get_completion_args(self) -> tuple[list[str], str]:
cwords = split_arg_string(os.environ["COMP_WORDS"])
Expand Down
Loading