Skip to content
Open
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 @@ -225,6 +225,11 @@ class ShellComplete:
be provided by subclasses.
"""

cli: Command
ctx_args: cabc.MutableMapping[str, t.Any]
prog_name: str
complete_var: str

def __init__(
self,
cli: Command,
Expand Down Expand Up @@ -308,8 +313,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 @@ -367,8 +372,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 @@ -403,8 +408,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