1 #compdef twistd trial conch cftp tapconvert ckeygen lore pyhtmlizer tap2deb tkconch manhole tap2rpm
3 # This is the ZSH completion file for Twisted commands. It calls the current
4 # command-line with the special "--_shell-completion" option which is handled
5 # by twisted.python.usage. t.p.usage then generates zsh code on stdout to
6 # handle the completions for this particular command-line.
8 # 3rd parties that wish to provide zsh completion for commands that
9 # use t.p.usage may copy this file and change the first line to reference
10 # the name(s) of their command(s).
12 # This file is included in the official Zsh distribution as
13 # Completion/Unix/Command/_twisted
15 # redirect stderr to /dev/null otherwise deprecation warnings may get puked all
16 # over the user's terminal if completing options for a deprecated command.
17 # Redirect stderr to a file to debug errors.
19 cmd=("$words[@]" --_shell-completion zsh:$CURRENT)
20 output=$("$cmd[@]" 2>/dev/null)
22 if [[ $output == "#compdef "* ]]; then
23 # Looks like we got a valid completion function - so eval it to produce
24 # the completion matches.
27 echo "\nCompletion error running command:" ${(qqq)cmd}
28 echo -n "If output below is unhelpful you may need to edit this file and "
29 echo "redirect stderr to a file."
30 echo "Expected completion function, but instead got:"