_tmuxinator 1016 B

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