symfony2.plugin.zsh 938 B

12345678910111213141516171819202122232425262728293031323334
  1. # Symfony2 basic command completion
  2. _symfony_console () {
  3. echo "php $(find . -maxdepth 2 -mindepth 1 -name 'console' -type f | head -n 1)"
  4. }
  5. _symfony2_get_command_list () {
  6. `_symfony_console` --no-ansi | sed "1,/Available commands/d" | awk '/^ ?[^ ]+ / { print $1 }'
  7. }
  8. _symfony2 () {
  9. compadd `_symfony2_get_command_list`
  10. }
  11. compdef _symfony2 '`_symfony_console`'
  12. compdef _symfony2 'app/console'
  13. compdef _symfony2 'bin/console'
  14. compdef _symfony2 sf
  15. #Alias
  16. alias sf='`_symfony_console`'
  17. alias sfcl='sf cache:clear'
  18. alias sfsr='sf server:run -vvv'
  19. alias sfcw='sf cache:warmup'
  20. alias sfroute='sf debug:router'
  21. alias sfcontainer='sf debug:container'
  22. alias sfgb='sf generate:bundle'
  23. alias sfgc='sf generate:controller'
  24. alias sfgcom='sf generate:command'
  25. alias sfge='sf doctrine:generate:entity'
  26. alias sfsu='sf doctrine:schema:update'
  27. alias sfdc='sf doctrine:database:create'
  28. alias sfdev='sf --env=dev'
  29. alias sfprod='sf --env=prod'