Funktionierender Prototyp des Serious Games zur Vermittlung von Wissen zu Software-Engineering-Arbeitsmodellen.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

twisted-completion.zsh 1.3KB

1 year ago
123456789101112131415161718192021222324252627282930313233
  1. #compdef twist twistd trial conch cftp ckeygen pyhtmlizer tkconch
  2. #
  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.
  7. #
  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).
  11. #
  12. # This file is included in the official Zsh distribution as
  13. # Completion/Unix/Command/_twisted
  14. # redirect stderr to /dev/null otherwise deprecation warnings may get puked all
  15. # over the user's terminal if completing options for a deprecated command.
  16. # Redirect stderr to a file to debug errors.
  17. local cmd output
  18. cmd=("$words[@]" --_shell-completion zsh:$CURRENT)
  19. output=$("$cmd[@]" 2>/dev/null)
  20. if [[ $output == "#compdef "* ]]; then
  21. # Looks like we got a valid completion function - so eval it to produce
  22. # the completion matches.
  23. eval $output
  24. else
  25. echo "\nCompletion error running command:" ${(qqq)cmd}
  26. echo -n "If output below is unhelpful you may need to edit this file and "
  27. echo "redirect stderr to a file."
  28. echo "Expected completion function, but instead got:"
  29. echo $output
  30. return 1
  31. fi