_tmuxinator 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. #compdef tmuxinator mux
  2. #autoload
  3. local curcontext="$curcontext" state line ret=1
  4. local -a _configs
  5. _arguments -C \
  6. '1: :->cmds' \
  7. '2:: :->args' && ret=0
  8. _configs=(${$(echo ~/.tmuxinator/*.yml):r:t})
  9. case $state in
  10. cmds)
  11. _values "tmuxinator command" \
  12. "new[create a new project file and open it in your editor]" \
  13. "start[start a tmux session using project's tmuxinator config]" \
  14. "open[create a new project file and open it in your editor]" \
  15. "copy[copy source_project project file to a new project called new_project]" \
  16. "delete[deletes the project called project_name]" \
  17. "debug[output the shell commands generated by a projet]" \
  18. "implode[deletes all existing projects!]" \
  19. "list[list all existing projects]" \
  20. "doctor[look for problems in your configuration]" \
  21. "help[shows this help document]" \
  22. "version[shows tmuxinator version number]" \
  23. $_configs
  24. ret=0
  25. ;;
  26. args)
  27. case $line[1] in
  28. start|open|copy|delete|debug)
  29. [[ -n "$_configs" ]] && _values 'configs' $_configs
  30. ret=0
  31. ;;
  32. esac
  33. ;;
  34. esac
  35. return ret