Qucs-S S-parameter Viewer & RF Synthesis Tools
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | Static Public Attributes | List of all members
click.shell_completion.ShellComplete Class Reference
Inheritance diagram for click.shell_completion.ShellComplete:
Inheritance graph
[legend]

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[CompletionItemget_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

name .ClassVar[str]
 
source_template .ClassVar[str]
 

Detailed Description

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

Member Function Documentation

◆ complete()

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.

◆ format_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.

◆ func_name()

str click.shell_completion.ShellComplete.func_name (   self)
The name of the shell function defined by the completion
script.

◆ get_completion_args()

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.

◆ get_completions()

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.

◆ source()

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.

◆ source_vars()

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``.

The documentation for this class was generated from the following file: