![]() |
Qucs-S S-parameter Viewer & RF Synthesis Tools
|

Public Member Functions | |
| None | __init__ (self, Command cli, cabc.MutableMapping[str, t.Any] ctx_args, str prog_name, str complete_var) |
| str | func_name (self) |
| dict[str, t.Any] | source_vars (self) |
| str | source (self) |
| tuple[list[str], str] | get_completion_args (self) |
| list[CompletionItem] | get_completions (self, list[str] args, str incomplete) |
| str | format_completion (self, CompletionItem item) |
| str | complete (self) |
Public Attributes | |
| cli | |
| ctx_args | |
| prog_name | |
| complete_var | |
| func_name | |
Static Public Attributes | |
| t | name .ClassVar[str] |
| t | source_template .ClassVar[str] |
Base class for providing shell completion support. A subclass for
a given shell will override attributes and methods to implement the
completion instructions (``source`` and ``complete``).
:param cli: Command being called.
:param prog_name: Name of the executable in the shell.
:param complete_var: Name of the environment variable that holds
the completion instruction.
.. versionadded:: 8.0
| str click.shell_completion.ShellComplete.complete | ( | self | ) |
Produce the completion data to send back to the shell. By default this calls :meth:`get_completion_args`, gets the completions, then calls :meth:`format_completion` for each completion.
| str click.shell_completion.ShellComplete.format_completion | ( | self, | |
| CompletionItem | item | ||
| ) |
Format a completion item into the form recognized by the shell script. This must be implemented by subclasses. :param item: Completion item to format.
Reimplemented in click.shell_completion.BashComplete, click.shell_completion.ZshComplete, and click.shell_completion.FishComplete.
| str click.shell_completion.ShellComplete.func_name | ( | self | ) |
The name of the shell function defined by the completion script.
| tuple[list[str], str] click.shell_completion.ShellComplete.get_completion_args | ( | self | ) |
Use the env vars defined by the shell script to return a tuple of ``args, incomplete``. This must be implemented by subclasses.
Reimplemented in click.shell_completion.BashComplete, click.shell_completion.ZshComplete, and click.shell_completion.FishComplete.
| list[CompletionItem] click.shell_completion.ShellComplete.get_completions | ( | self, | |
| list[str] | args, | ||
| str | incomplete | ||
| ) |
Determine the context and last complete command or parameter from the complete args. Call that object's ``shell_complete`` method to get the completions for the incomplete value. :param args: List of complete args before the incomplete value. :param incomplete: Value being completed. May be empty.
| str click.shell_completion.ShellComplete.source | ( | self | ) |
Produce the shell script that defines the completion function. By default this ``%``-style formats :attr:`source_template` with the dict returned by :meth:`source_vars`.
Reimplemented in click.shell_completion.BashComplete.
| dict[str, t.Any] click.shell_completion.ShellComplete.source_vars | ( | self | ) |
Vars for formatting :attr:`source_template`. By default this provides ``complete_func``, ``complete_var``, and ``prog_name``.