Go to the latest version of this document.
search in docstrings

Search bar offers the following options:

- Term presence. The below example searches for documents that must contain “foo”, might contain “bar” and must not contain “baz”: `+foo bar -baz`
- Wildcards. The below example searches for documents with words beginning with “foo”: `foo*`
- Search in specific fields. The following search matches all objects in "twisted.mail" that matches “search”: `+qname:twisted.mail.* +search`

  Possible fields: 'name', 'qname' (fully qualified name), 'docstring', and 'kind'. Last two fields are only applicable if "search in docstrings" is enabled.

- Fuzzy matches. The following search matches all documents that have a word within 1 edit distance of “foo”: `foo~1`

Results provided by Lunr.js

# ``twisted`.`python`.`_shellcomp``

module documentation
(source)

No public APIs are provided by this module. Internal use only.

This module implements dynamic tab-completion for any command that uses twisted.python.usage. Currently, only zsh is supported. Bash support may be added in the future.

Maintainer: Eric P. Mangold - twisted AT teratorn DOT org

In order for zsh completion to take place the shell must be able to find an appropriate "stub" file ("completion function") that invokes this code and displays the results to the user.

The stub used for Twisted commands is in the file `twisted-completion.zsh`, which is also included in the official Zsh distribution at `Completion/Unix/Command/_twisted`. Use this file as a basis for completion functions for your own commands. You should only need to change the first line to something like `#compdef mycommand`.

The main public documentation exists in the `twisted.python.usage.Options` docstring, the `twisted.python.usage.Completions` docstring, and the Options howto.

Class | `SubcommandAction` | Undocumented
Class | `ZshArgumentsGenerator` | Generate a call to the zsh _arguments completion function based on data in a usage.Options instance
Class | `ZshBuilder` | Constructs zsh code that will complete options for a given usage.Options instance, possibly including a list of subcommand names.
Class | `ZshSubcommandBuilder` | Constructs zsh code that will complete options for a given usage.Options instance, and also for a single sub-command. This will only be used in the case where the user is completing options for a specific subcommand.
Function | `descrFromDoc` | Generate an appropriate description from docstring of the given object
Function | `escape` | Shell escape the given string
Function | `shellComplete` | Perform shell completion.

def descrFromDoc(obj): (source)

Generate an appropriate description from docstring of the given object

def escape(x): (source)

Shell escape the given string

Implementation borrowed from now-deprecated commands.mkarg() in the stdlib

def shellComplete(config, cmdName, words, shellCompFile): (source)

Perform shell completion.

A completion function (shell script) is generated for the requested shell and written to `shellCompFile`, typically `stdout`. The result is then eval'd by the shell to produce the desired completions.

Parameters
config:`twisted.python.usage.Options` | The `twisted.python.usage.Options` instance to generate completions for.
cmdName:`str` | The name of the command we're generating completions for. In the case of zsh, this is used to print an appropriate "#compdef $CMD" line at the top of the output. This is not necessary for the functionality of the system, but it helps in debugging, since the output we produce is properly formed and may be saved in a file and used as a stand-alone completion function.
words:`list` of `str` | The raw command-line words passed to use by the shell stub function. argv[0] has already been stripped off.
shellCompFile:`file` | The file to write completion data to.