_tmuxinator 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. #compdef tmuxinator mux
  2. # ------------------------------------------------------------------------------
  3. # Copyright (c) 2010-2016 Christopher Chow
  4. #
  5. # Permission is hereby granted, free of charge, to any person obtaining
  6. # a copy of this software and associated documentation files (the
  7. # "Software"), to deal in the Software without restriction, including
  8. # without limitation the rights to use, copy, modify, merge, publish,
  9. # distribute, sublicense, and/or sell copies of the Software, and to
  10. # permit persons to whom the Software is furnished to do so, subject to
  11. # the following conditions:
  12. #
  13. # The above copyright notice and this permission notice shall be
  14. # included in all copies or substantial portions of the Software.
  15. #
  16. # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
  17. # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  18. # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
  19. # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
  20. # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
  21. # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
  22. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  23. # ------------------------------------------------------------------------------
  24. #
  25. # Description
  26. # -----------
  27. #
  28. # Completion script for tmuxinator (https://github.com/tmuxinator/tmuxinator)
  29. #
  30. # ------------------------------------------------------------------------------
  31. # Authors
  32. # -------
  33. #
  34. # * Christopher Chow (https://github.com/Soliah)
  35. #
  36. # ------------------------------------------------------------------------------
  37. _tmuxinator() {
  38. local commands projects
  39. commands=(${(f)"$(tmuxinator commands zsh)"})
  40. projects=(${(f)"$(tmuxinator completions start)"})
  41. if (( CURRENT == 2 )); then
  42. _describe -t commands "tmuxinator subcommands" commands
  43. _describe -t projects "tmuxinator projects" projects
  44. elif (( CURRENT == 3)); then
  45. case $words[2] in
  46. copy|debug|delete|open|start)
  47. _arguments '*:projects:($projects)'
  48. ;;
  49. esac
  50. fi
  51. return
  52. }
  53. _tmuxinator
  54. # Local Variables:
  55. # mode: Shell-Script
  56. # sh-indentation: 2
  57. # indent-tabs-mode: nil
  58. # sh-basic-offset: 2
  59. # End:
  60. # vim: ft=zsh sw=2 ts=2 et