_tmuxinator 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738
  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. case $state in
  9. cmds)
  10. _values "tmuxinator command" \
  11. "new[create a new project file and open it in your editor]" \
  12. "start[start a tmux session using project's tmuxinator config]" \
  13. "open[create a new project file and open it in your editor]" \
  14. "copy[copy source_project project file to a new project called new_project]" \
  15. "delete[deletes the project called project_name]" \
  16. "debug[output the shell commands generated by a projet]" \
  17. "implode[deletes all existing projects!]" \
  18. "list[list all existing projects]" \
  19. "doctor[look for problems in your configuration]" \
  20. "help[shows this help document]" \
  21. "version[shows tmuxinator version number]"
  22. ret=0
  23. ;;
  24. args)
  25. case $line[1] in
  26. start|open|copy|delete|debug)
  27. _configs=(`find ~/.tmuxinator -name \*.yml | cut -d/ -f5 | sed s:.yml::g`)
  28. [[ -n "$_configs" ]] && _values 'configs' $_configs
  29. ret=0
  30. ;;
  31. esac
  32. ;;
  33. esac
  34. return ret